Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

Commit

Permalink
Add some more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
voxpelli committed Sep 9, 2021
1 parent f0af00c commit de3b74a
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 6 deletions.
16 changes: 10 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,16 @@
"clean:declarations": "rm -rf $(find . -maxdepth 2 -type f -name '*.d.ts')",
"clean": "run-p clean:*",
"prepublishOnly": "run-s build",
"test-cli:custom-detective": "node cli.js test/mock-positive/ -e js:detective-cjs",
"test-cli:glob": "node cli.js 'test/mock-positive/**/*.js' --no-default-entries",
"test-cli:multi-glob": "node cli.js test/mock-positive/foo.js 'test/mock-positive/*.js' \"test/mock-positive/donkey/*.js\" --no-default-entries",
"test-cli:main-as-file": "node cli.js test/mock-positive/index.js",
"test-cli:simple": "node cli.js test/mock-positive/",
"test-cli": "run-p test-cli:*",

"test-cli:negative:ts": "node cli.js test/mock-negative/abc.ts 2>&1 >/dev/null | grep \"code: @scope/test1\\|\\.json: example, example2\" | wc -l | grep '2' > /dev/null",
"test-cli:negative:simple": "node cli.js test/mock-negative/ 2>&1 >/dev/null | grep \"code: @scope/test1\\|\\.json: example, example2\" | wc -l | grep '2' > /dev/null",
"test-cli:positive:custom-detective": "node cli.js test/mock-positive/ -e js:detective-cjs",
"test-cli:positive:glob": "node cli.js 'test/mock-positive/**/*.js' --no-default-entries",
"test-cli:positive:multi-glob": "node cli.js test/mock-positive/foo.js 'test/mock-positive/*.js' \"test/mock-positive/donkey/*.js\" --no-default-entries",
"test-cli:positive:ts": "node cli.js test/mock-positive/abc.ts",
"test-cli:positive:main-as-file": "node cli.js test/mock-positive/index.js",
"test-cli:positive:simple": "node cli.js test/mock-positive/",
"test-cli": "run-p test-cli:**",
"test": "run-s check test-cli"
},
"husky": {
Expand Down
4 changes: 4 additions & 0 deletions test/mock-negative/abc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// @ts-ignore
import example from 'example'
// @ts-ignore
import bar from './bar.cjs'
2 changes: 2 additions & 0 deletions test/mock-negative/bar.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
const example2 = require('example2');
const async = require('async');
2 changes: 2 additions & 0 deletions test/mock-negative/foo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
const example2 = require('example2');
const async = require('async');
2 changes: 2 additions & 0 deletions test/mock-negative/index.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import example from 'example'
import foo from './foo.js'
9 changes: 9 additions & 0 deletions test/mock-negative/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "test-negative",
"version": "0.0.1",
"main": "index.mjs",
"dependencies": {
"async": "*",
"@scope/test1": "*"
}
}
1 change: 1 addition & 0 deletions test/mock-positive/abc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import foo from './foo.js'

0 comments on commit de3b74a

Please sign in to comment.