Comments (6)
Comment by Sanjo
Wednesday Apr 13, 2016 at 04:45 GMT
Right now you can probably force a file to load first by prefixing the file name with __. E.g. __beforeAll.js. Because files are loaded in alphabetical order I think.
from chimpy.
Comment by samhatoum
Thursday May 12, 2016 at 19:21 GMT
@joshhunt did this work for you guys?
from chimpy.
Comment by joshhunt
Tuesday Jun 07, 2016 at 08:49 GMT
Sorry for dropping off the grid - I'll check this out tomorrow and report back!
from chimpy.
Comment by montogeek
Tuesday Aug 02, 2016 at 22:44 GMT
@joshhunt are you back?
from chimpy.
Comment by tiagolr
Friday Mar 17, 2017 at 21:45 GMT
I am using two different options for this:
1 - run code in chimp.config.js
that executes in chimp process before tests start
2 - run code in this.BeforeFeatures(...)
that executes in cucumber process before tests start
In your case the first option should work well, I'm using it too to setup global variables.
Here is a pasteBin of my config file:
http://pastebin.com/fXeVVTiW
edit: the configs contain a verification to prevent cucumber process from parsing the file, that has to do with the script and tests folder location.
from chimpy.
Comment by paulbjensen
Sunday Aug 13, 2017 at 07:19 GMT
Hi,
I tried the suggestion that @sanjo made, and it works. I created a file named __beforeAll.test.js, and places it inside of the test/controllers folder in my app, as npm test script would load files from that directory first, e.g.
"script": {
"test": "NODE_ENV=test mocha test/**/* test/*"
}
I needed to load the timekeeper npm module first to intercept the Date class in order to create a test relating to time, and so needed to load timekeeper before all of the application's code, as timekeeper mocks the Date
class and Date.now
function.
Thanks to @sanjo for the suggestion.
from chimpy.
Related Issues (20)
- Node 10.1.0, Chimp and fibers problem (can we upgrade fibers?) HOT 33
- Hooks errors fix for #687 HOT 5
- Security vulnerability HOT 5
- Chrome render issue with chimp
- Make chimp work with JDK10 HOT 6
- Difference between this repo(Chimpy) and Chimp HOT 4
- wrapAsync is not defined HOT 2
- Problems running chimpy on Gitlab `Error: unknown error: Chrome failed to start: exited abnormally` HOT 6
- Chimpy doesn't appear to support Sauce Connect (which is required for testing non-public apps via Sauce Labs)
- Output still references to chimp and outdated website.
- Support latest version of Chrome! HOT 6
- I can't run the unit tests for Chimpy HOT 4
- Using import syntax in config file throws error
- Chimpy crashes upon app server restart with --ddp flag HOT 2
- chromedriver 2.46.0 download URL invalid
- Adding chimpy as dev-dependency breaks app HOT 2
- node 12: bump fibers dependency HOT 13
- cannot install dev-dependencies -> jest-cli dependency is invalid
- Lots of warnings on deprecation of packages with Node 11.10.x itself HOT 2
- Project Abandoned, future of this project? HOT 2
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 chimpy.