TypeError: Cannot set property id of #<Test> which has only a getter
See original GitHub issueWhat are you trying to achieve?
After initializing a CodeceptJS project, when trying to run the tests, I have an exception (see below)
What do you get instead?
TypeError: Cannot set property id of #<Test> which has only a getter
at {root}/node_modules/codeceptjs/lib/mochaFactory.js:53:46
at Array.forEach (<anonymous>)
at Suite.eachTest ({root}/node_modules/mocha/lib/suite.js:438:14)
at {root}/node_modules/mocha/lib/suite.js:440:11
at Array.forEach (<anonymous>)
at Suite.eachTest ({root}/node_modules/mocha/lib/suite.js:439:15)
at Mocha.mocha.loadFiles ({root}/node_modules/codeceptjs/lib/mochaFactory.js:53:21)
at CodeceptjsFactory.reloadSuites ({root}/node_modules/@codeceptjs/ui/lib/model/codeceptjs-factory.js:141:11)
at Object.reloadSuites ({root}/node_modules/@codeceptjs/ui/lib/model/scenario-repository.js:217:30)
at module.exports ({root}/node_modules/@codeceptjs/ui/lib/api/list-scenarios.js:9:22)
Details
- CodeceptJS version: 3.0.0
- NodeJS Version: 14.3.0
- Operating System: OSX 10.15.5
- Configuration file:
const { setHeadlessWhen } = require('@codeceptjs/configure');
// turn on headless mode when running with HEADLESS=true environment variable
// export HEADLESS=true && npx codeceptjs run
setHeadlessWhen(process.env.HEADLESS);
exports.config = {
tests: './tests/*_test.js',
output: './output',
helpers: {
Puppeteer: {
url: 'http://localhost',
show: true,
windowSize: '1200x900'
}
},
include: {
I: './steps_file.js'
},
bootstrap: null,
mocha: {},
name: 'hello-codecept',
plugins: {
pauseOnFail: {},
retryFailedStep: {
enabled: true
},
tryTo: {
enabled: true
},
screenshotOnFail: {
enabled: true
}
}
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Getting "cannot set property name of which has only a getter"
Nowhere in the code have I tried to set a property. Either way, it seems to throw the error before running my tests....
Read more >TypeError: setting getter-only property "x" - JavaScript | MDN
There is an attempt to set a new value to a property for which only a getter is specified. While this will be...
Read more >TypeError: setting getter-only property "x" - JavaScript
There is an attempt to set a new value to a property for which only a getter is specified. While this will be...
Read more >JavaScript TypeError - Setting getter-only property "x"
Cause of the Error: The user is trying to set a new value to a property for which only a getter is defined....
Read more >TypeError: setting getter-only property "x" - Javascript MDN 文档
There is an attempt to set a new value to a property for which only a getter is specified. While this will be...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
upgrading from 3.0.0 to 3.0.1, fixed it for me
with 3.0.1 it works… maybe the template is being created with wrong package dependency…