Skip to content

Commit 356ecf5

Browse files
committed
Refactoring testcase to TypeScript
1 parent 87d0b3e commit 356ecf5

File tree

11 files changed

+408
-341
lines changed

11 files changed

+408
-341
lines changed

.gitignore

Lines changed: 42 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,65 @@
1+
# Created by https://www.gitignore.io/api/node
2+
3+
### Node ###
14
# Logs
25
logs
36
*.log
7+
npm-debug.log*
8+
yarn-debug.log*
9+
yarn-error.log*
410

511
# Runtime data
612
pids
713
*.pid
814
*.seed
15+
*.pid.lock
916

1017
# Directory for instrumented libs generated by jscoverage/JSCover
1118
lib-cov
1219

1320
# Coverage directory used by tools like istanbul
1421
coverage
1522

23+
# nyc test coverage
24+
.nyc_output
25+
1626
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
1727
.grunt
1828

29+
# Bower dependency directory (https://bower.io/)
30+
bower_components
31+
32+
# node-waf configuration
33+
.lock-wscript
34+
1935
# Compiled binary addons (http://nodejs.org/api/addons.html)
2036
build/Release
2137

22-
# Dependency directory
23-
# Commenting this out is preferred by some people, see
24-
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-
25-
node_modules
38+
# Dependency directories
39+
node_modules/
40+
jspm_packages/
41+
42+
# Typescript v1 declaration files
43+
typings/
44+
45+
# Optional npm cache directory
46+
.npm
47+
48+
# Optional eslint cache
49+
.eslintcache
50+
51+
# Optional REPL history
52+
.node_repl_history
53+
54+
# Output of 'npm pack'
55+
*.tgz
56+
57+
# Yarn Integrity file
58+
.yarn-integrity
59+
60+
# dotenv environment variables file
61+
.env
62+
2663

27-
# Users Environment Variables
28-
.lock-wscript
2964

30-
# Garbage files
31-
.DS_Store
65+
# End of https://www.gitignore.io/api/node

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
sudo: false
22
language: node_js
33
node_js:
4+
- 'stable'
45
- '8'
56
- '6'
67
- '4'
7-
- '0.12'
8-
- '0.10'
98
after_script:
109
- npm run coveralls

appveyor.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@
44
environment:
55
matrix:
66
# node.js
7-
- nodejs_version: "0.10"
8-
- nodejs_version: "0.12"
9-
- nodejs_version: "4"
10-
- nodejs_version: "6"
7+
- nodejs_version: "stable"
118
- nodejs_version: "8"
9+
- nodejs_version: "6"
10+
- nodejs_version: "4"
1211

1312
install:
1413
- ps: Install-Product node $env:nodejs_version

index.d.ts

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,12 @@ declare namespace PluginError {
55
*/
66
new(options: Options & {plugin: string, message: string}): PluginError;
77

8-
/**
9-
* @param plugin Plugin name
10-
* @param message Error message
11-
* @param options Error options
12-
*/
13-
new (plugin: string, message: string, options?: Options): PluginError;
14-
15-
/**
16-
* @param plugin Plugin name
17-
* @param error Base error
18-
* @param options Error options
19-
*/
20-
new <E extends Error>(plugin: string, error: E, options?: Options): PluginError<E>;
21-
228
/**
239
* @param plugin Plugin name
2410
* @param error Base error / Error message
2511
* @param options Error options
2612
*/
27-
new <E extends Error>(plugin: string, error: E | string, options?: Options): PluginError<E | {[K in keyof E]: undefined}>;
13+
new <E extends Error>(plugin: string, error: E | string, options?: Options): PluginError<E>;
2814

2915
/**
3016
* @param plugin Plugin name

package.json

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,13 @@
1919
"index.js"
2020
],
2121
"scripts": {
22-
"lint": "eslint . && jscs index.js test/",
23-
"pretest": "npm run lint",
24-
"test": "mocha --async-only && npm run test-types",
25-
"test-types": "tsc -p test/types",
26-
"cover": "istanbul cover _mocha --report lcovonly",
27-
"coveralls": "npm run cover && istanbul-coveralls"
22+
"lint:eslint": "eslint .",
23+
"lint:jscs": "jscs index.js",
24+
"lint:tslint": "tslint --project test/",
25+
"lint:tsc": "tsc --project test/",
26+
"pretest": "npm-run-all --parallel lint:*",
27+
"test": "mocha --async-only --compilers ts:ts-node/register",
28+
"coveralls": "nyc npm test && nyc report --reporter=text-lcov | coveralls"
2829
},
2930
"dependencies": {
3031
"ansi-colors": "^1.0.1",
@@ -33,14 +34,21 @@
3334
"extend-shallow": "^3.0.2"
3435
},
3536
"devDependencies": {
36-
"eslint": "^1.7.3",
37-
"eslint-config-gulp": "^2.0.0",
38-
"expect": "^1.20.2",
39-
"istanbul": "^0.4.3",
40-
"istanbul-coveralls": "^1.0.3",
41-
"jscs": "^2.3.5",
37+
"@types/expect.js": "^0.3.29",
38+
"@types/mocha": "^2.2.46",
39+
"@types/node": "^9.3.0",
40+
"coveralls": "^3.0.0",
41+
"eslint": "^1.10.3",
42+
"eslint-config-gulp": "^2.1.0",
43+
"expect": "^22.1.0",
44+
"expect.js": "^0.3.1",
45+
"jscs": "^3.0.7",
4246
"jscs-preset-gulp": "^1.0.0",
43-
"mocha": "^3.0.0",
47+
"mocha": "^5.0.0",
48+
"npm-run-all": "^4.1.2",
49+
"nyc": "^11.4.1",
50+
"ts-node": "^4.1.0",
51+
"tslint": "^5.9.1",
4452
"typescript": "^2.6.2"
4553
},
4654
"keywords": [

test/.eslintrc

Lines changed: 0 additions & 3 deletions
This file was deleted.

test/index.js

Lines changed: 0 additions & 216 deletions
This file was deleted.

0 commit comments

Comments
 (0)