Comments (11)
I thought I would add to this, I managed to include a boot.js file by doing the follow:
{
"spec_dir": "app/server/",
"spec_files": [
"../../.utilities/boot.js", //this
"**/*.test.js"
],
"helpers": [
"helpers/**/*.js"
]
}
from jasmine-npm.
Whilst getting custom boot to work may be a bit more challenging, do you think the fact that the helpers are not loaded when a specific test is specified is a bug? If so, perhaps I should create a PR to resolve that bug in the mean time?
from jasmine-npm.
It probably makes sense for the CLI to use the jasmine.json configuration as defaults that the CLI then overrides. You could file an issue/PR for the helper files not being loaded.
When you add a reporter, the default reporter is no longer added.
There is no boot_files option for jasmine.json. Right now you can not use a custom boot from the command line. All this module does for booting is use the boot exposed by the jasmine-core module. You can optionally pass in a jasmineCore to this module, so you could just pass in your own instance of jasmineCore and then define your own boot method on the core. https://github.com/jasmine/jasmine-npm/blob/master/lib/jasmine.js#L14
from jasmine-npm.
@mattheworiordan What are you trying to do in a boot file? Are you able to solve your problems with a helper file instead? Right now there's a bug in tracker for fixing helper file loading when specifying files to run on the command line.
If this gets fixed so helpers are always loaded correctly, does this fix your issue?
from jasmine-npm.
I'm in a similar situation. I'm trying to load BabelJS through the boot.js
. I have a "working" setup with gulp, but I'm hoping to run a single spec with the jasmine CLI without pre-compiling my source/spec.
from jasmine-npm.
Sorry for the slow reply on this. In the end I actually abandoned Jasmine as I just couldn't get it to behave the way I needed, not specifically this issue though.
In terms of why I could not use helpers, yes, I expect when that bug is fixed that would have solved my problem indeed. Thanks.
from jasmine-npm.
@whitehat101 The helper files should be loaded properly even when specifying files to execute now on master. If you get a chance, can you take a look and see if adding a helper that does the extra stuff you want in a boot solves your problem? If not, we'd like to know what would need to be added to make a helper file sufficient.
Thanks for using jasmine!
from jasmine-npm.
The fix for loading helper files properly should be released with 2.3 now. From what I can tell that should solve this issue, so I'm going to close it.
from jasmine-npm.
I'm trying to use something like the custom_boot.js to make a webpack loader for Jasmine tests, so that it can inject the Jasmine methods into test modules. This is also necessary because I'm using Meteor, which also injects variables, and they wouldn't be present if I let Jasmine run the tests itself. The way both Meteor and Jasmine prefer to load and run js files themselves really gets in the way of interoperability, it makes the developer jump through hoops. Meteor's Velocity test framework has figured out how to run things with Jasmine, but Velocity has some severe limitations (e.g. you can't do anything like Karma as far as I know).
from jasmine-npm.
@jedwards1211 if you're looking to run the tests in a browser, you want to just go straight to jasmine-core, which is just the base jasmine files. You might also see if something like gulp-jasmine-browser will work for you, it should be capable of doing a webpack server as well.
from jasmine-npm.
I'm running both server and client-side tests. Here is my somewhat hacky workaround:
- Use a custom Webpack loader for test modules. It wraps them in
function(jasmine)
and at the top of the function, useseval
to put everything injasmine.getEnv()
on the local scope. - Inside the Velocity Jasmine test scripts, I call those functions, passing the fake
jasmine
whosegetEnv()
returns the Jasmine globals on the local scope of the Velocity Jasmine test scripts.
from jasmine-npm.
Related Issues (20)
- jasmine flags, oneFailurePerSpec and stopSpecOnExpectationFailure don't work well HOT 2
- RFC: Well-defined public API HOT 1
- Can't get Jasmine 4 to support .jsx files HOT 7
- Failed to load reporter module jasmine 4.x HOT 1
- Jasmine loads test dependency as CommonJS module instead of ESM HOT 2
- Export Loader HOT 2
- getting an error jasmine.getEnv is not a function HOT 2
- Unable to find specs when using [email protected] HOT 2
- Consider using child_process.fork() to parallelize Jasmine runs HOT 28
- Jasmine 4 ES Modules / Dynamic Import Doesn't Work with Paths that Have Encoded Slashes HOT 4
- jasmine --helper flag broken following addHelperFiles() removal
- --reporter does not work with namespaced modules HOT 4
- Feature Request: Allow re-running test suites without restarting HOT 2
- Package subpath './lib/command.js' is not defined by "exports" using jasmine-xml-reporter HOT 1
- Vulnerabilities found on latest version of Jasmine(4.6.0) HOT 1
- Problem excluding files HOT 4
- Project base dirs containing special Glob syntax don't work HOT 1
- Regression in jasmine 5: settings bleed over to next `Jasmine` instance HOT 4
- `--require` fails with `runner.addRequires is not a function` in 5.x HOT 1
- Add a `--verbose` flag 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 jasmine-npm.