main
Last change
on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 4 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
673 bytes
|
Line | |
---|
1 | import * as assert from 'assert';
|
---|
2 | import test, { describe } from 'node:test';
|
---|
3 | import version from '../version.js';
|
---|
4 | import { TESTS } from './test_constants.js';
|
---|
5 | describe('version()', () => {
|
---|
6 | test('TESTS cases', () => {
|
---|
7 | for (const { value, expectedValidate, expectedVersion } of TESTS) {
|
---|
8 | try {
|
---|
9 | const actualVersion = version(value);
|
---|
10 | assert.ok(expectedValidate, `version(${value}) should throw`);
|
---|
11 | assert.strictEqual(actualVersion, expectedVersion);
|
---|
12 | }
|
---|
13 | catch {
|
---|
14 | assert.ok(!expectedValidate, `version(${value}) threw unexpectedly`);
|
---|
15 | }
|
---|
16 | }
|
---|
17 | });
|
---|
18 | });
|
---|
Note:
See
TracBrowser
for help on using the repository browser.