File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change
1
+ import { test } from 'node:test' ;
2
+ import assert from 'node:assert' ;
3
+
1
4
import { parseVersionFromString } from './parsers.js' ;
2
5
3
6
test ( 'Parse version from ProjectVersion.txt' , ( ) => {
4
7
const projectVersionContents = `m_EditorVersion: 2019.2.9f1
5
8
m_EditorVersionWithRevision: 2019.2.9f1 (ebce4d76e6e8)` ;
6
9
7
- expect ( parseVersionFromString ( projectVersionContents ) ) . toBe ( '2019.2.9f1' ) ;
10
+ assert . strictEqual (
11
+ parseVersionFromString ( projectVersionContents ) ,
12
+ '2019.2.9f1'
13
+ ) ;
8
14
} ) ;
9
15
10
16
test ( 'Fail to parse version from empty string' , ( ) => {
11
- expect ( ( ) => parseVersionFromString ( '' ) ) . toThrow ( Error ) ;
17
+ assert . throws ( ( ) => parseVersionFromString ( '' ) , {
18
+ name : 'Error' ,
19
+ message : 'Failed to parse version from string.' ,
20
+ } ) ;
12
21
} ) ;
Original file line number Diff line number Diff line change 24
24
},
25
25
"scripts" : {
26
26
"start" : " node bin/index.js" ,
27
- "test" : " npx cross-env NODE_OPTIONS=--experimental-vm-modules jest " ,
27
+ "test" : " node --test lib/parsers.test.js " ,
28
28
"update" : " node bin/index.js --force" ,
29
29
"postinstall" : " npm run update"
30
30
},
You can’t perform that action at this time.
0 commit comments