File tree Expand file tree Collapse file tree 15 files changed +29
-14
lines changed Expand file tree Collapse file tree 15 files changed +29
-14
lines changed Original file line number Diff line number Diff line change 21
21
"clean" : " rimraf --glob dist *.tsbuildinfo *.done.build.log" ,
22
22
"prettier" : " prettier --check . --ignore-path ../../.prettierignore" ,
23
23
"prettier:fix" : " prettier --write . --ignore-path ../../.prettierignore" ,
24
- "test" : " npm run test" ,
24
+ "test" : " npm run test:local " ,
25
25
"test:local" : " node --no-warnings --experimental-vm-modules ./node_modules/jest/bin/jest.js --testPathPattern=\" .*\\ .spec\\ .js\" " ,
26
26
"test:local:debug" : " node --inspect-brk --no-warnings --experimental-vm-modules ./node_modules/jest/bin/jest.js --testPathPattern=\" .*\\ .spec\\ .js\" " ,
27
27
"tsc" : " tsc -b"
Original file line number Diff line number Diff line change 23
23
"clean" : " rimraf --glob dist *.tsbuildinfo *.done.build.log" ,
24
24
"prettier" : " prettier --check . --ignore-path ../../.prettierignore" ,
25
25
"prettier:fix" : " prettier --write . --ignore-path ../../prettierignore" ,
26
- "test" : " npm run test" ,
26
+ "test" : " npm run test:local " ,
27
27
"test:local" : " node --no-warnings --experimental-vm-modules ./node_modules/jest/bin/jest.js --testPathPattern=\" .*\\ .spec\\ .js\" " ,
28
28
"test:local:debug" : " node --inspect-brk --no-warnings --experimental-vm-modules ./node_modules/jest/bin/jest.js --testPathPattern=\" .*\\ .spec\\ .js\" " ,
29
29
"tsc" : " tsc -b"
Original file line number Diff line number Diff line change @@ -147,7 +147,7 @@ function validateObject(
147
147
ignoreExtraneous ?. includes ( actualField ) !== true
148
148
) {
149
149
const fullName = name ? `${ name } .${ actualField } ` : actualField ;
150
- throw new Error ( `Extraneous property ${ fullName } ` ) ;
150
+ throw new Error ( `Extraneous property ' ${ fullName } ' ` ) ;
151
151
}
152
152
}
153
153
}
Original file line number Diff line number Diff line change @@ -52,7 +52,9 @@ async function executeAction(
52
52
case "add" :
53
53
const { a, b } = action . parameters ;
54
54
return createActionResult ( `The sum of ${ a } and ${ b } is ${ a + b } ` ) ;
55
+ case "random" :
56
+ return createActionResult ( `Random number: ${ Math . random ( ) } ` ) ;
55
57
default :
56
- throw new Error ( `Unknown action: ${ action . actionName } ` ) ;
58
+ throw new Error ( `Unknown action: ${ ( action as any ) . actionName } ` ) ;
57
59
}
58
60
}
Original file line number Diff line number Diff line change 1
1
// Copyright (c) Microsoft Corporation.
2
2
// Licensed under the MIT License.
3
3
4
- export type TestActions = AddAction ;
4
+ export type TestActions = AddAction | RandomNumberAction ;
5
5
type AddAction = {
6
6
actionName : "add" ;
7
7
parameters : {
8
8
a : number ;
9
9
b : number ;
10
10
} ;
11
11
} ;
12
+
13
+ type RandomNumberAction = {
14
+ actionName : "random" ;
15
+ } ;
Original file line number Diff line number Diff line change 22
22
"clean" : " rimraf --glob dist *.tsbuildinfo *.done.build.log" ,
23
23
"prettier" : " prettier --check . --ignore-path ../../.prettierignore" ,
24
24
"prettier:fix" : " prettier --write . --ignore-path ../../prettierignore" ,
25
- "test" : " npm run test" ,
25
+ "test" : " npm run test:local " ,
26
26
"test:local" : " node --no-warnings --experimental-vm-modules ./node_modules/jest/bin/jest.js --testPathPattern=\" .*\\ .spec\\ .js\" " ,
27
27
"test:local:debug" : " node --inspect-brk --no-warnings --experimental-vm-modules ./node_modules/jest/bin/jest.js --testPathPattern=\" .*\\ .spec\\ .js\" " ,
28
28
"tsc" : " tsc -b"
Original file line number Diff line number Diff line change 18
18
"prettier" : " prettier --check . --ignore-path ../../.prettierignore" ,
19
19
"prettier:fix" : " prettier --write . --ignore-path ../../.prettierignore" ,
20
20
"start" : " node ./dist/index.js" ,
21
- "test" : " npm run test" ,
21
+ "test" : " npm run test:local " ,
22
22
"test:local" : " node --no-warnings --experimental-vm-modules ./node_modules/jest/bin/jest.js --testPathPattern=\" .*\\ .spec\\ .js\" " ,
23
23
"test:local:debug" : " node --inspect-brk --no-warnings --experimental-vm-modules ./node_modules/jest/bin/jest.js --testPathPattern=\" .*\\ .spec\\ .js\" " ,
24
24
"tsc" : " tsc -b"
Original file line number Diff line number Diff line change 22
22
"clean" : " rimraf --glob dist *.tsbuildinfo *.done.build.log" ,
23
23
"prettier" : " prettier --check . --ignore-path ../../.prettierignore" ,
24
24
"prettier:fix" : " prettier --write . --ignore-path ../../.prettierignore" ,
25
- "test" : " npm run test" ,
25
+ "test" : " npm run test:local " ,
26
26
"test:local" : " node --no-warnings --experimental-vm-modules ./node_modules/jest/bin/jest.js --testPathPattern=\" .*\\ .spec\\ .js\" " ,
27
27
"test:local:debug" : " node --inspect-brk --no-warnings --experimental-vm-modules ./node_modules/jest/bin/jest.js --testPathPattern=\" .*\\ .spec\\ .js\" " ,
28
28
"tsc" : " tsc -b"
Original file line number Diff line number Diff line change 23
23
"clean" : " rimraf --glob dist *.tsbuildinfo *.done.build.log" ,
24
24
"prettier" : " prettier --check . --ignore-path ../../.prettierignore" ,
25
25
"prettier:fix" : " prettier --write . --ignore-path ../../.prettierignore" ,
26
- "test" : " npm run test" ,
26
+ "test" : " npm run test:local " ,
27
27
"test:local" : " node --no-warnings --experimental-vm-modules ./node_modules/jest/bin/jest.js --testPathPattern=\" .*\\ .spec\\ .js\" " ,
28
28
"test:local:debug" : " node --inspect-brk --no-warnings --experimental-vm-modules ./node_modules/jest/bin/jest.js --testPathPattern=\" .*\\ .spec\\ .js\" " ,
29
29
"tsc" : " tsc -b"
Original file line number Diff line number Diff line change 27
27
"clean" : " rimraf --glob dist *.tsbuildinfo *.done.build.log" ,
28
28
"prettier" : " prettier --check . --ignore-path ../../.prettierignore" ,
29
29
"prettier:fix" : " prettier --write . --ignore-path ../../.prettierignore" ,
30
- "test" : " npm run test" ,
30
+ "test" : " npm run test:local " ,
31
31
"test:local" : " node --no-warnings --experimental-vm-modules ./node_modules/jest/bin/jest.js --testPathPattern=\" .*\\ .spec\\ .js\" " ,
32
32
"test:local:debug" : " node --inspect-brk --no-warnings --experimental-vm-modules ./node_modules/jest/bin/jest.js --testPathPattern=\" .*\\ .spec\\ .js\" " ,
33
33
"tsc" : " tsc -b"
You can’t perform that action at this time.
0 commit comments