When I try to run my frisbyjs tests with jest as documented on the github page, I get the following error:
RangeError: Maximum call stack size exceeded
at String.slice (native)
at Object.resolve (path.js:290:29)
at resolveConfigPathByTraversing (C:\Users\me\AppData\Roaming\npm\node_modules\jest\node_modules\jest-config\build\resolve_config_path.js:58:54)
at resolveConfigPathByTraversing (C:\Users\me\AppData\Roaming\npm\node_modules\jest\node_modules\jest-config\build\resolve_config_path.js:75:10)
at resolveConfigPathByTraversing (C:\Users\me\AppData\Roaming\npm\node_modules\jest\node_modules\jest-config\build\resolve_config_path.js:75:10)
at resolveConfigPathByTraversing (C:\Users\me\AppData\Roaming\npm\node_modules\jest\node_modules\jest-config\build\resolve_config_path.js:75:10)
at resolveConfigPathByTraversing (C:\Users\me\AppData\Roaming\npm\node_modules\jest\node_modules\jest-config\build\resolve_config_path.js:75:10)
at resolveConfigPathByTraversing (C:\Users\me\AppData\Roaming\npm\node_modules\jest\node_modules\jest-config\build\resolve_config_path.js:75:10)
at resolveConfigPathByTraversing (C:\Users\me\AppData\Roaming\npm\node_modules\jest\node_modules\jest-config\build\resolve_config_path.js:75:10)
at resolveConfigPathByTraversing (C:\Users\me\AppData\Roaming\npm\node_modules\jest\node_modules\jest-config\build\resolve_config_path.js:75:10)
I believe I have the correct file structure, using "__tests__" and my test file "api.spec.js" in that folder, but I might have something wrong going on. Disclaimer: I'm brand new to Javascript and all related knowledge. I previously worked on Java.
I'm working on a proof of concept using Frisby with Jasmine to write live API tests. My current project structure is as follows:
- __tests__
- helpers
- environment.js
- api.spec.js
- helpers
The file contents are as follows:
environment.js
module.exports = {
oneApiUrl: "https://mywebsite.net/",
twoApiUrl: "https://myotherwebsite.com/projectpoint/",
dashboardProjectsApi: 'api/dashboard/projects/get',
token: 'tokenstringhere',
};
api.spec.js
const frisby = require('frisby');
const environment = require('./helpers/environment.js');
frisby.globalSetup({
request: {
headers: {
'Authorization': 'Bearer ' + environment.token,
}
}
});
describe('Dashboard api', function () {
it('should return list of projects this user can access', function (done) {
frisby.get(environment.oneApiUrl + environment.dashboardProjectsApi)
.expect('status', 200)
.done(done);
});
});
I'm pretty sure it's not the test, as this works if I do jasmine-node .\api.spec.js
. I can go with using jasmine-node
, but there's benefits to using jest
and I would like to know why this isn't working.
I tried Googling the error, but this error typically comes from issues related to a javascript website, doubling up on imports in the html, etc. I don't think mine is related to that, as I'm trying to run the js file like one would run python, with an interpreter. (As far as I understand.)
Any suggestions/critiques are appreciated!