diff --git a/lib/parsers.test.js b/lib/parsers.test.js index 6cb4351..2d50ed9 100644 --- a/lib/parsers.test.js +++ b/lib/parsers.test.js @@ -1,12 +1,21 @@ +import { test } from 'node:test'; +import assert from 'node:assert'; + import { parseVersionFromString } from './parsers.js'; test('Parse version from ProjectVersion.txt', () => { const projectVersionContents = `m_EditorVersion: 2019.2.9f1 m_EditorVersionWithRevision: 2019.2.9f1 (ebce4d76e6e8)`; - expect(parseVersionFromString(projectVersionContents)).toBe('2019.2.9f1'); + assert.strictEqual( + parseVersionFromString(projectVersionContents), + '2019.2.9f1' + ); }); test('Fail to parse version from empty string', () => { - expect(() => parseVersionFromString('')).toThrow(Error); + assert.throws(() => parseVersionFromString(''), { + name: 'Error', + message: 'Failed to parse version from string.', + }); }); diff --git a/package.json b/package.json index a30a76b..c2f15c7 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ }, "scripts": { "start": "node bin/index.js", - "test": "npx cross-env NODE_OPTIONS=--experimental-vm-modules jest", + "test": "node --test lib/parsers.test.js", "update": "node bin/index.js --force", "postinstall": "npm run update" },