Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while running a test as defined into the Documentation #202

Open
qarachit opened this issue Sep 25, 2019 · 1 comment
Open

Error while running a test as defined into the Documentation #202

qarachit opened this issue Sep 25, 2019 · 1 comment

Comments

@qarachit
Copy link

Followed the steps mentioned here
https://gannettdigital.github.io/simulato/tutorial/first-component/

but while running command npm run test

it gives me following error, what does it mean?

D:\simulato-tutorial\node_modules\simulato\lib\util\validators\validate-test-cases.js:20
throw new SimulatoError.TEST_CASE.TEST_CASE_NOT_ARRAY(
^

TestcaseError TEST_CASE_NOT_ARRAY: The test case at path 'D:\simulato-tutorial\tests\simulato--fc14bc7020ede9154c717117f0e6c8aaca1f408e36a13abf0c05b8d05d6b36df.json' must be an Array
at new TEST_CASE_ERROR (D:\simulato-tutorial\node_modules\simulato\lib\errors\test-case\test-case-error.js:6:10)
at new module.exports (D:\simulato-tutorial\node_modules\simulato\lib\errors\test-case\test-case-not-array.js:6:10)
at EventEmitter.module.exports (D:\simulato-tutorial\node_modules\simulato\lib\util\validators\validate-test-cases.js:20:13)
at EventEmitter.emit (events.js:189:13)
at EventEmitter.emit (D:\simulato-tutorial\node_modules\simulato\lib\util\emitter.js:18:33)
at EventEmitter.emit (D:\simulato-tutorial\node_modules\simulato\lib\util\emitter.js:20:27)
at EventEmitter.emit (D:\simulato-tutorial\node_modules\simulato\lib\util\emitter.js:20:27)
at D:\simulato-tutorial\node_modules\simulato\lib\cli\commands\run.js:16:11
at EventEmitter.search (D:\simulato-tutorial\node_modules\simulato\lib\util\find-files.js:35:12)
at EventEmitter.emit (events.js:189:13)

@scottgunther
Copy link
Contributor

Yeah we are working on fixing that issue soon. It is happening because we have a couple algorithms that generate the tests and one got out of sync with the rest of the codebase. That one isn't used by us that much anymore and we forgot to update it and switch the default to the newer one.

To get around this in the mean time just create a config file with these contents:

'use strict';

module.exports = {
  plannerAlgorithm: 'actionTree',
};

And then update the command in package.json to use the config like this:

"generate-tests": "simulato generate -o ./tests -f config.js"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants