-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactoring(move-to-es6): update code using ES6 standart (#21)
- Loading branch information
Showing
13 changed files
with
661 additions
and
497 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
node_modules | ||
screenshots | ||
demo | ||
coverage/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module.exports = { | ||
'extends': [ | ||
'airbnb-base', | ||
'eslint:recommended' | ||
], | ||
'rules': { | ||
'linebreak-style': 0 | ||
}, | ||
"env": { | ||
"jest": true | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,3 +21,5 @@ node_modules | |
|
||
# WebStorm project metadata stuff | ||
.idea/ | ||
package-lock.json | ||
coverage/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,18 @@ | ||
var miniJasmineLib = require('minijasminenode2'), | ||
TestsReporter = require('../index').Jasmine2Reporter, | ||
options = { | ||
pendingSpec: true, | ||
colors: { | ||
pending: 'yellow', | ||
}, | ||
symbols: { | ||
pending: '* '.strikethrough, //strikethrough is a colors module feature | ||
} | ||
}; | ||
const Jasmine2Reporter = require('../src/Jasmine2Reporter'); | ||
const miniJasmineLib = require('minijasminenode2'); | ||
|
||
miniJasmineLib.addSpecs('demo/specs.js'); | ||
miniJasmineLib.addReporter(new TestsReporter(options)); | ||
const options = { | ||
pendingSpec: true, | ||
colors: { | ||
pending: 'yellow', | ||
}, | ||
symbols: { | ||
pending: '* '.strikethrough, // strikethrough is a colors module feature | ||
}, | ||
}; | ||
|
||
miniJasmineLib.addSpecs('specs.js'); | ||
miniJasmineLib.addReporter(new Jasmine2Reporter(options)); | ||
miniJasmineLib.executeSpecs({ | ||
silent: true | ||
}) | ||
silent: true, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +0,0 @@ | ||
module.exports.Jasmine2Reporter = require('./src/Reporter.js').Jasmine2Reporter; | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
const Calculator = require('./Calculator'); | ||
const TerminalLogger = require('./TerminalLogger'); | ||
|
||
class Jasmine2Reporter { | ||
constructor(options, cb) { | ||
this.started = false; | ||
this.finished = false; | ||
this.loggerNo = 1; | ||
this.calc = new Calculator(); | ||
this.logger = new TerminalLogger(options); | ||
this.jasmineCallback = cb; | ||
} | ||
|
||
jasmineStarted(runner) { | ||
this.started = true; | ||
this.calc.start(runner.totalSpecsDefined); | ||
this.logger.start(runner, this.calc); | ||
} | ||
|
||
jasmineDone(summary) { | ||
this.calc.stop(); | ||
this.logger.stop(this.calc); | ||
this.finished = true; | ||
if (this.jasmineCallback) { | ||
this.jasmineCallback(summary); | ||
} | ||
} | ||
|
||
suiteStarted(suite) { | ||
this.calc.startSuite(suite); | ||
this.logger.startSuite(suite, this.calc); | ||
} | ||
|
||
suiteDone(suite) { | ||
this.calc.stopSuite(suite); | ||
this.logger.stopSuite(suite, this.calc); | ||
} | ||
|
||
specStarted(spec) { | ||
this.calc.startSpec(spec); | ||
this.logger.startSpec(spec); | ||
} | ||
|
||
specDone(spec) { | ||
this.calc.stopSpec(spec); | ||
this.logger.stopSpec(spec, this.calc); | ||
} | ||
} | ||
|
||
module.exports = Jasmine2Reporter; |
Oops, something went wrong.