Comments (9)
Can't you just add it as a reporter in the options?
from gulp-jasmine.
I'd like to use default terminal reporter that comes with gulp-jasmine
dependency.
If I write this:
.pipe($.jasmine({ verbose: true, reporter: failFast.init() }))
it'll override the default reporters.
I'd have to install terminal reporter separately and add it to array.
from gulp-jasmine.
I still think that it's preferable to exporting the jasmine object, especially since we are creating a new instance when you call $.jasmine(), so we couldn't export it before. I don't see a strong case for having 2 ways of adding reporters or configuring jasmine. Closing for now, feel free to discuss here some more if you feel differently.
from gulp-jasmine.
That's fine. Indeed it's not a strong case. Maybe it'll be worth reconsidering if other people feel the need in this for some different reasons.
from gulp-jasmine.
Actually that didn't work:
var failFast = require('jasmine-fail-fast');
var Reporter = require('jasmine-terminal-reporter');
var terminalReporter = new Reporter({
isVerbose: true,
showColors: true,
includeStackTrace: false
});
return gulp.src('./spec/*.js')
.pipe($.jasmine({ reporter: [terminalReporter, failFast.init()] }));
The failFast.init()
expects a global variable jasmine
. It's probably not a design flaw. At least I'm not sure how I'd tweak failFast
to avoid this issue.
Basically I don't know how to make this work without exporting jasmine
from gulp-jasmine
.
from gulp-jasmine.
And how about you implement it as a helper (https://github.com/Updater/jasmine-fail-fast#as-a-jasmine-helper)?
I'm not sure it'll work, I'm not that familiar with helpers, but I think helpers give you access to the jasmine instance.
from gulp-jasmine.
my understanding is that helpers are just a way of configuring the global jasmine
object.
However, gulp-jasmine
ignores global jasmine
object. It creates a new instance of Jasmine
.
Perhaps the whole thing would work if variable jasmine
inside gulp-jasmine
was declared like that:
var jasmine = jasmine || new Jasmine();
This way if there is a global jasmine
variable, it'd be used instead of a fresh instance.
from gulp-jasmine.
@DmitryEfimenko My understanding is that helpers are 'reinstalled' every time we call jasmine.execute
on te jasmine instance. That's the reason we are clearing them first. Let me know if you've tried it and it didn't work, but I'm pretty sure it should.
from gulp-jasmine.
you are right. I misunderstood what helpers are. It all worked.
For anyone who might need it, this is what the code looks like for me (besides adding the actual helper):
var terminalReporter = new TerminalReporter({ isVerbose: true, showColors: true, includeStackTrace: false });
gulp.src('./spec/*.js').pipe($.jasmine({
reporter: [terminalReporter],
config: { spec_dir: 'spec', helpers: ['./helpers/**/*.js'] }
}))
from gulp-jasmine.
Related Issues (20)
- Unable to give references of file needed in specs from gulpfile.js
- Issue DEPRECATION : Setting randomizeTests directly is deprecated, please use the random option in `configure`
- Update Jasmine to 3.4 HOT 2
- Upgrade to jasmine 4 HOT 3
- issues with require caching HOT 4
- Replace silent reporter with onComplete callback
- Error trying to use config in Node 6
- Broken with Jasmine 2.5.0? HOT 9
- Config option for custom Jasmine-instance HOT 4
- gulp-jasmine runs the tests twice when Jasmine version is 2.5.2 HOT 3
- Tests that should fail pass using gulp-jasmine HOT 1
- jasmine doesn't seem to run HOT 1
- Jasmine never getting called if over 16 files loaded HOT 2
- jasmineDone event not called when tests fail
- process exits with exit code 0 when tests fail HOT 3
- Cannot load module using require.
- deleteRequireCache blows the stack for circlular referenced files HOT 3
- MaxListenersExceededWarning: Possible EventEmitter memory leak detected. HOT 1
- Running a focused test throws an error when it shouldn't. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gulp-jasmine.