File tree 3 files changed +16
-4
lines changed
3 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -2,10 +2,16 @@ language: node_js
2
2
matrix :
3
3
include :
4
4
- node_js : ' stable'
5
+ env : TASK=test
5
6
- node_js : ' node'
6
- env : VERSION=v12.0.0-rc.1
7
+ env : TASK=test VERSION=v12.0.0-rc.1
7
8
before_install : NVM_NODEJS_ORG_MIRROR=https://nodejs.org/download/rc nvm install $VERSION
8
- script : npm test
9
+ - node_js : ' stable'
10
+ env : TASK=test-native
11
+ - node_js : ' node'
12
+ env : TASK=test-native VERSION=v12.0.0-rc.1
13
+ before_install : NVM_NODEJS_ORG_MIRROR=https://nodejs.org/download/rc nvm install $VERSION
14
+ script : npm run $TASK
9
15
notifications :
10
16
email :
11
17
on_success : never
Original file line number Diff line number Diff line change 7
7
"homepage" : " https://github.com/browserify/commonjs-assert" ,
8
8
"repository" : " browserify/commonjs-assert" ,
9
9
"scripts" : {
10
- "test" : " node test.js"
10
+ "test" : " node test.js" ,
11
+ "test-native" : " cross-env TEST_NATIVE=true npm test"
11
12
},
12
13
"keywords" : [
13
14
" assert" ,
14
15
" browser"
15
16
],
16
17
"devDependencies" : {
18
+ "cross-env" : " ^5.2.0" ,
17
19
"glob" : " ^7.1.3" ,
20
+ "proxyquire" : " ^2.1.0" ,
18
21
"tape" : " ^4.10.1"
19
22
}
20
23
}
Original file line number Diff line number Diff line change 1
1
const test = require ( 'tape' ) ;
2
2
const glob = require ( 'glob' ) ;
3
3
const path = require ( 'path' ) ;
4
+ const proxyquire = require ( 'proxyquire' ) ;
5
+
6
+ const assert = require ( process . env . TEST_NATIVE === 'true' ? 'assert' : '.' ) ;
4
7
5
8
const testPaths = glob . sync ( 'test/**/test-assert*.js' ) ;
6
9
7
10
testPaths . forEach ( testPath => {
8
11
test ( testPath , t => {
9
12
t . doesNotThrow ( ( ) => {
10
- require ( path . resolve ( __dirname , testPath ) ) ;
13
+ proxyquire ( path . resolve ( __dirname , testPath ) , { assert } ) ;
11
14
} ) ;
12
15
t . end ( ) ;
13
16
} ) ;
You can’t perform that action at this time.
0 commit comments