فهرست منبع

Istanbul code coverage

sanex3339 9 سال پیش
والد
کامیت
365c5fda10
3فایلهای تغییر یافته به همراه29 افزوده شده و 7 حذف شده
  1. 4 2
      .gitignore
  2. 8 5
      package.json
  3. 17 0
      tsconfig-test.json

+ 4 - 2
.gitignore

@@ -1,5 +1,7 @@
 .idea
-node_modules
 npm-debug.log
 *.js.map
-tmp
+/coverage
+/node_modules
+/test-tmp
+/tmp

+ 8 - 5
package.json

@@ -24,6 +24,7 @@
     "babel-polyfill": "^6.9.1",
     "babel-preset-es2015": "^6.9.0",
     "chai": "^3.5.0",
+    "istanbul": "^1.0.0-alpha.2",
     "lite-server": "^1.3.1",
     "mocha": "^2.5.3",
     "source-map-support": "^0.4.0",
@@ -39,15 +40,17 @@
     "url": "git+https://github.com/sanex3339/javascript-obfuscator.git"
   },
   "scripts": {
-    "tsc": "tsc",
-    "tsc:w": "tsc -w",
+    "lite": "lite-server",
     "webpack": "node_modules/.bin/webpack",
+    "build": "npm run webpack && npm test",
     "watch": "node_modules/.bin/webpack --watch",
-    "lite": "lite-server",
     "start": "concurrent \"npm run tsc:w\" \"npm run lite\" ",
+    "test:compile": "tsc -p tsconfig-test.json",
     "test:dev": "node test/dev/test.js",
-    "test:mocha": "mocha --require ts-node/register test/**/*.spec.ts",
-    "test": "npm run test:dev && npm run test:mocha",
+    "test:full": "npm run test:compile && istanbul cover _mocha -- test-tmp/test/**/**.spec.js && npm run test:removeTestTmpDir",
+    "test:mocha": "npm run test:compile && mocha -- test-tmp/test/**/**.spec.js && npm run test:removeTestTmpDir",
+    "test:removeTestTmpDir": "rm -rf test-tmp",
+    "test": "npm run test:dev && npm run test:full",
     "typings": "node_modules/.bin/typings install"
   },
   "author": {

+ 17 - 0
tsconfig-test.json

@@ -0,0 +1,17 @@
+{
+  "compilerOptions": {
+    "outDir": "test-tmp",
+    "target": "ES6",
+    "module": "commonjs",
+    "sourceMap": true,
+    "emitDecoratorMetadata": true,
+    "experimentalDecorators": true,
+    "removeComments": true,
+    "noImplicitAny": true
+  },
+  "exclude": [
+    "node_modules",
+    "typings/browser",
+    "typings/browser.d.ts"
+  ]
+}