mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2026-10-17 08:42:28 +00:00
progress
This commit is contained in:
1 parent
ce8398f749
commit
41b9116c6a
60 files changed
+7525
-340
No files matched your search
@@ -5,8 +5,8 @@ import { exampleData } from '$lib/data/example/example-data';
|
||||
import { exampleStatistics } from '$lib/data/example';
|
||||
|
||||
describe('exampleStatistics', () => {
|
||||
it('has the statistics of the whole example for the whole range', () => {
|
||||
const whole = exampleStatistics.slice(0, exampleStatistics.length - 1);
|
||||
it('has the statistics of the whole example for the whole range', async () => {
|
||||
const whole = await exampleStatistics.slice(0, exampleStatistics.length - 1);
|
||||
const global = exampleStatistics.global;
|
||||
assert.ok(whole);
|
||||
for (const key of [
|
||||
@@ -25,17 +25,17 @@ describe('exampleStatistics', () => {
|
||||
}
|
||||
});
|
||||
|
||||
it('has no speed for a range that does not last', () => {
|
||||
const point = exampleStatistics.slice(20, 20);
|
||||
it('has no speed for a range that does not last', async () => {
|
||||
const point = await exampleStatistics.slice(20, 20);
|
||||
assert.equal(point?.totalTime, 0);
|
||||
assert.equal(point?.totalSpeed, undefined);
|
||||
assert.equal(point?.movingSpeed, undefined);
|
||||
});
|
||||
|
||||
it('has nothing for ranges that are not in the example', () => {
|
||||
assert.equal(exampleStatistics.slice(5, 500), undefined);
|
||||
assert.equal(exampleStatistics.slice(-1, 3), undefined);
|
||||
assert.equal(exampleStatistics.slice(10, 5), undefined);
|
||||
it('has nothing for ranges that are not in the example', async () => {
|
||||
assert.equal(await exampleStatistics.slice(5, 500), undefined);
|
||||
assert.equal(await exampleStatistics.slice(-1, 3), undefined);
|
||||
assert.equal(await exampleStatistics.slice(10, 5), undefined);
|
||||
});
|
||||
|
||||
it(
|
||||
|
||||
@@ -20,7 +20,7 @@ const cumulative = {
|
||||
};
|
||||
|
||||
/** The statistics of the trackpoints from `start` to `end` (both included), as the engine does. */
|
||||
function slice(start: number, end: number): GlobalStatistics | undefined {
|
||||
async function slice(start: number, end: number): Promise<GlobalStatistics | undefined> {
|
||||
if (!(start >= 0 && start <= end && end < length)) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user