File tree 4 files changed +56
-1
lines changed
4 files changed +56
-1
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ function is_already_formatted() {
28
28
29
29
if is_already_formatted; then
30
30
mocha --napi-modules examples/calculator.js
31
+ node --napi-modules $( which jest)
31
32
else
32
33
echo " You should run |bacardi format| command first."
33
34
fi
Original file line number Diff line number Diff line change 1
1
{
2
2
"devDependencies" : {
3
+ "@types/jest" : " ^21.1.2" ,
3
4
"@types/node" : " ^8.0.24" ,
4
5
"bindings" : " ^1.3.0" ,
6
+ "jest" : " ^21.2.1" ,
7
+ "mkdirp" : " ^0.5.1" ,
5
8
"mocha" : " ^3.5.0" ,
6
9
"node-addon-api" : " ^0.6.3" ,
7
10
"node-gyp" : " ^3.6.2" ,
8
11
"nunjucks" : " ^3.0.1" ,
9
- "mkdirp" : " ^0.5.1" ,
10
12
"snake-case" : " ^2.1.0" ,
13
+ "ts-jest" : " ^21.1.0" ,
11
14
"typescript" : " ^2.4.2" ,
12
15
"webidl2" : " ^4.1.0"
13
16
},
14
17
"optionalDependencies" : {
15
18
"windows-build-tools" : " ^1.3.2"
19
+ },
20
+ "jest" : {
21
+ "moduleFileExtensions" : [
22
+ " js" ,
23
+ " json" ,
24
+ " jsx" ,
25
+ " ts" ,
26
+ " tsx"
27
+ ],
28
+ "testMatch" : [
29
+ " **/*.test.(ts|tsx)"
30
+ ],
31
+ "transform" : {
32
+ "^.+\\ .(ts|tsx)$" : " <rootDir>/node_modules/ts-jest/preprocessor.js"
33
+ }
16
34
}
17
35
}
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Copyright (c) 2017 The Bacardi Authors.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import * as bindings from 'bindings' ;
18
+
19
+ const bacardi = bindings ( 'bacardi.node' ) ;
20
+
21
+ test ( 'Constructor basic' , async ( ) => {
22
+ let test_interface : bacardi . TestInterface = new bacardi . TestInterface ( ) ;
23
+ expect ( true ) . toBe ( test_interface instanceof bacardi . TestInterface ) ;
24
+ } ) ;
Original file line number Diff line number Diff line change
1
+ {
2
+ "compileOnSave" : true ,
3
+ "compilerOptions" : {
4
+ "baseUrl" : " ." ,
5
+ "experimentalDecorators" : true ,
6
+ "noImplicitAny" : true ,
7
+ "noImplicitReturns" : true ,
8
+ "preserveConstEnums" : true ,
9
+ "sourceMap" : true ,
10
+ "target" : " es5"
11
+ }
12
+ }
You can’t perform that action at this time.
0 commit comments