File tree 6 files changed +40
-63
lines changed
6 files changed +40
-63
lines changed Original file line number Diff line number Diff line change @@ -4,8 +4,3 @@ node_modules
4
4
* .log
5
5
.DS_Store
6
6
.nyc_output
7
- .test
8
- .tmp
9
-
10
- # build-artifacts
11
- dist
Original file line number Diff line number Diff line change @@ -4,11 +4,7 @@ node_modules
4
4
* .log
5
5
.DS_Store
6
6
.nyc_output
7
- .test
8
- .tmp
9
7
10
8
# source/config
11
- src
12
- test
13
9
* .yml
14
10
.gitignore
Original file line number Diff line number Diff line change 5
5
"bugs" : {
6
6
"url" : " https://github.com/semantic-release/error/issues"
7
7
},
8
- "config" : {
9
- "nyc" : {
10
- "exclude" : [
11
- " .test" ,
12
- " node_modules"
13
- ]
14
- }
15
- },
16
8
"devDependencies" : {
17
- "babel" : " 5.8.23" ,
18
9
"coveralls" : " 2.11.4" ,
19
- "mkdirp" : " 0.5.1" ,
20
10
"nyc" : " 3.2.2" ,
21
- "rimraf" : " 2.4.3" ,
22
11
"semantic-release" : " 4.3.5" ,
23
12
"standard" : " 5.4.1" ,
24
13
"tap" : " 2.2.0"
29
18
" semantic-release"
30
19
],
31
20
"license" : " MIT" ,
32
- "main" : " dist /index.js" ,
21
+ "main" : " src /index.js" ,
33
22
"repository" : {
34
23
"type" : " git" ,
35
24
"url" : " https://github.com/semantic-release/error.git"
36
25
},
37
26
"scripts" : {
38
- "build" : " rimraf dist && mkdirp dist && babel src --out-dir dist" ,
39
- "build:tests" : " rimraf .test && mkdirp .test && babel test --out-dir .test" ,
40
27
"coverage" : " nyc report" ,
41
- "coverage:upload" : " npm run coverage -- --reporter=lcovonly && coveralls < coverage/lcov.info" ,
42
- "prepublish" : " npm run build" ,
43
- "pretest:suite" : " npm run build && npm run build:tests" ,
28
+ "coverage:upload" : " npm run -s coverage -- --reporter=text-lcov | coveralls" ,
29
+ "pretest" : " standard" ,
44
30
"semantic-release" : " semantic-release pre && npm publish && semantic-release post" ,
45
- "test" : " npm run test:style && npm run test:suite" ,
46
- "test:style" : " standard" ,
47
- "test:suite" : " nyc tap --no-cov .test/{scenarios,specs}/*.js"
31
+ "test" : " nyc tap --no-cov test/*.js"
48
32
}
49
33
}
Original file line number Diff line number Diff line change 1
- module . exports = class SemanticReleaseError extends Error {
2
- constructor ( message , code ) {
3
- super ( )
4
- this . message = message
5
- this . code = code
6
- }
1
+ module . exports = SemanticReleaseError
2
+
3
+ SemanticReleaseError . prototype = new Error ( )
4
+ function SemanticReleaseError ( message , code ) {
5
+ Error . captureStackTrace ( this , this . constructor )
6
+ this . name = this . constructor . name
7
+ this . message = message
8
+ this . code = code
7
9
}
Original file line number Diff line number Diff line change
1
+ var test = require ( 'tap' ) . test
2
+
3
+ var SemanticReleaseError = require ( '../' )
4
+
5
+ test ( 'instanciates error' , function ( t ) {
6
+ var error = new SemanticReleaseError ( )
7
+
8
+ t . ok ( error instanceof Error )
9
+ t . end ( )
10
+ } )
11
+
12
+ test ( 'sets message' , function ( t ) {
13
+ var message = 'foo'
14
+ var error = new SemanticReleaseError ( message )
15
+
16
+ t . is ( error . message , message )
17
+ t . end ( )
18
+ } )
19
+
20
+ test ( 'sets message and code' , function ( t ) {
21
+ var code = 'ENOFOO'
22
+ var message = 'bar'
23
+ var error = new SemanticReleaseError ( message , code )
24
+
25
+ t . is ( error . code , code )
26
+ t . is ( error . message , message )
27
+ t . end ( )
28
+ } )
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments