diff --git a/package.json b/package.json index 8494059..64f22c5 100644 --- a/package.json +++ b/package.json @@ -3,12 +3,6 @@ "description": "Parse a .skiz file exported from Ski Tracks", "version": "0.0.0-development", "author": "Kirk Eaton ", - "ava": { - "files": [ - "test/**/*.test.js" - ], - "timeout": "2m" - }, "bugs": { "url": "https://github.com/kirkeaton/skiz-parser/issues" }, @@ -19,7 +13,6 @@ }, "devDependencies": { "@types/node": "20.10.6", - "ava": "6.0.1", "husky": "8.0.3", "lint-staged": "15.2.0", "prettier": "3.1.1", @@ -65,7 +58,7 @@ }, "scripts": { "prepare": "husky install", - "test": "ava -v && tsd" + "test": "node --test && tsd" }, "type": "module" } diff --git a/test/index.test.js b/test/index.test.js index 376d905..3c8f0a7 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -1,5 +1,6 @@ -import test from 'ava'; import { promises as fsAsync } from 'fs'; +import assert from 'node:assert/strict'; +import test from 'node:test'; import path from 'path'; import { fileURLToPath } from 'url'; @@ -12,19 +13,19 @@ test('should parse .skiz file using promises', async (t) => { const file = await fsAsync.readFile(filename); const result = await parseSkizFile(file); - t.is(result.name, 'Day 15 - 2020/2021'); - t.is(result.activity, 'skiing'); - t.truthy(result.trackMetrics); - t.truthy(result.trackEvents); - t.truthy(result.trackSegments); - t.truthy(result.trackNodes); - t.truthy(result.batteryUsage); - t.truthy(result.relativeAltitude); - t.truthy(result.trackEvents.length); - t.truthy(result.trackSegments.length); - t.truthy(result.trackNodes.length); - t.truthy(result.batteryUsage.length); - t.truthy(result.relativeAltitude.length); + assert.equal(result.name, 'Day 15 - 2020/2021'); + assert.equal(result.activity, 'skiing'); + assert.ok(result.trackMetrics); + assert.ok(result.trackEvents); + assert.ok(result.trackSegments); + assert.ok(result.trackNodes); + assert.ok(result.batteryUsage); + assert.ok(result.relativeAltitude); + assert.ok(result.trackEvents.length); + assert.ok(result.trackSegments.length); + assert.ok(result.trackNodes.length); + assert.ok(result.batteryUsage.length); + assert.ok(result.relativeAltitude.length); }); test('should parse .skiz file using callback', async (t) => { @@ -35,19 +36,19 @@ test('should parse .skiz file using callback', async (t) => { return reject(err); } - t.is(result.name, 'Day 15 - 2020/2021'); - t.is(result.activity, 'skiing'); - t.truthy(result.trackMetrics); - t.truthy(result.trackEvents); - t.truthy(result.trackSegments); - t.truthy(result.trackNodes); - t.truthy(result.batteryUsage); - t.truthy(result.relativeAltitude); - t.truthy(result.trackEvents.length); - t.truthy(result.trackSegments.length); - t.truthy(result.trackNodes.length); - t.truthy(result.batteryUsage.length); - t.truthy(result.relativeAltitude.length); + assert.equal(result.name, 'Day 15 - 2020/2021'); + assert.equal(result.activity, 'skiing'); + assert.ok(result.trackMetrics); + assert.ok(result.trackEvents); + assert.ok(result.trackSegments); + assert.ok(result.trackNodes); + assert.ok(result.batteryUsage); + assert.ok(result.relativeAltitude); + assert.ok(result.trackEvents.length); + assert.ok(result.trackSegments.length); + assert.ok(result.trackNodes.length); + assert.ok(result.batteryUsage.length); + assert.ok(result.relativeAltitude.length); resolve(); }); });