This repository was archived by the owner on Aug 19, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +356
-21
lines changed Expand file tree Collapse file tree 3 files changed +356
-21
lines changed Original file line number Diff line number Diff line change 1010 "babelify" : " ^7.3.0" ,
1111 "browserify" : " ^14.0.0" ,
1212 "eslint" : " ^3.18.0" ,
13+ "husky" : " ^0.13.2" ,
14+ "lint-staged" : " ^3.4.0" ,
1315 "mocha" : " ^3.0.1" ,
1416 "nyc" : " ^10.0.0" ,
17+ "prettier" : " ^0.22.0" ,
1518 "semantic-release" : " ^6.3.2"
1619 },
1720 "babel" : {
2427 "test" : " npm run lint && npm run test-only" ,
2528 "test-only" : " nyc --require babel-register mocha -u exports" ,
2629 "build" : " browserify -t [ babelify --presets [ es2015 ] ] src/ErrorSubclass.js --standalone ErrorSubclass > umd.js" ,
27- "lint" : " eslint src test " ,
30+ "lint" : " eslint src" ,
2831 "prepublish" : " npm run build" ,
29- "semantic-release" : " semantic-release pre && npm publish && semantic-release post"
32+ "semantic-release" : " semantic-release pre && npm publish && semantic-release post" ,
33+ "precommit" : " lint-staged"
3034 },
3135 "author" : " Stephen Sorensen <shuoink@gmail.com> (http://www.stephenjohnsorensen.com/)" ,
3236 "license" : " MIT" ,
3943 ],
4044 "eslintConfig" : {
4145 "extends" : " @spudly"
46+ },
47+ "lint-staged" : {
48+ "*.js" : [
49+ " eslint --fix" ,
50+ " prettier --write --print-width=100 --single-quote --bracket-spacing=false 'src/**/*.js'" ,
51+ " git add"
52+ ]
4253 }
4354}
Original file line number Diff line number Diff line change @@ -10,17 +10,13 @@ class SubSubError extends ErrorSubclass {
1010const { captureStackTrace} = Error ;
1111
1212const tests = {
13-
1413 ErrorSubclass : {
15-
1614 'Subclass of ErrorSubclass' : {
17-
1815 'can be instantiated' : ( ) => {
1916 doesNotThrow ( ( ) => new SubSubError ( ERROR_MESSAGE ) ) ;
2017 } ,
2118
2219 'SubSubclass instance' : {
23-
2420 afterEach ( ) {
2521 Error . captureStackTrace = captureStackTrace ;
2622 } ,
@@ -53,14 +49,14 @@ const tests = {
5349 ok ( instance . stack ) ;
5450 equal ( typeof instance . stack , 'string' ) ;
5551 ok ( instance . stack . match ( `SubSubErrorDisplayName: ${ ERROR_MESSAGE } ` ) ) ;
56- } ,
52+ }
5753
5854 // 'when captureStackTrace is not supported, should have a stack': () => {
5955 // // TODO: how to test?
6056 // },
61- } ,
62- } ,
63- } ,
57+ }
58+ }
59+ }
6460} ;
6561
6662export default tests ;
You can’t perform that action at this time.
0 commit comments