Discussion:
[Cucumber] typescript transpiler: setDefaultTimeout
Add Reply
g***@gmail.com
2018-05-03 22:01:11 UTC
Reply
Permalink
Raw Message
Hello,

I'm using cucumber-js and everything seemed to work fine until I tried to
override the default timeout in a support file.

The error seems to indicate that the typescript file 'support.ts' is being
treated like a feature file:

Below is the error:

Error: Parse error in 'features/support/timeout.ts': (1:1): expected: #EOF,
#Language, #TagLine, #FeatureLine, #Comment, #Empty, got 'import {
setDefaultTimeout} from 'cucumber''
at
/home/me/src/my-stuff/cucumber-ts-node/node_modules/cucumber/src/cli/helpers.js:66:13
at Array.forEach (<anonymous>)
at
/home/me/src/my-stuff/cucumber-ts-node/node_modules/cucumber/src/cli/helpers.js:54:10
at Generator.next (<anonymous>)
at Generator.tryCatcher
(/home/me/src/my-stuff/cucumber-ts-node/node_modules/bluebird/js/release/util.js:16:23)
at PromiseSpawn._promiseFulfilled
(/home/me/src/my-stuff/cucumber-ts-node/node_modules/bluebird/js/release/generators.js:97:49)
at
/home/me/src/my-stuff/cucumber-ts-node/node_modules/bluebird/js/release/generators.js:201:15
at getTestCases
(/home/me/src/my-stuff/cucumber-ts-node/node_modules/cucumber/lib/cli/helpers.js:102:18)
at
/home/me/src/my-stuff/cucumber-ts-node/node_modules/cucumber/src/cli/helpers.js:32:13
at Generator.next (<anonymous>)
at Generator.tryCatcher
(/home/me/src/my-stuff/cucumber-ts-node/node_modules/bluebird/js/release/util.js:16:23)
at PromiseSpawn._promiseFulfilled
(/home/me/src/my-stuff/cucumber-ts-node/node_modules/bluebird/js/release/generators.js:97:49)
at Promise._settlePromise
(/home/me/src/my-stuff/cucumber-ts-node/node_modules/bluebird/js/release/promise.js:574:26)
at Promise._settlePromise0
(/home/me/src/my-stuff/cucumber-ts-node/node_modules/bluebird/js/release/promise.js:614:10)
at Promise._settlePromises
(/home/me/src/my-stuff/cucumber-ts-node/node_modules/bluebird/js/release/promise.js:693:18)
at Async._drainQueue
(/home/me/src/my-stuff/cucumber-ts-node/node_modules/bluebird/js/release/async.js:133:16)
npm ERR! Test failed. See above for more details.

This repo reproduces the error:
https://github.com/gforceg/ts-cucumberjs-timeout-problem

There is probably something simple that I'm missing but I haven't found a
solution in prior issues / documentation yet.

Thanks.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
g***@gmail.com
2018-05-04 16:44:48 UTC
Reply
Permalink
Raw Message
This issue seems to occur if I more than one typescript file is present.
If I put all of my code in a single typescript it works

Is this a bug or am I doing it wrong?

Thanks,
Greg
Post by g***@gmail.com
Hello,
I'm using cucumber-js and everything seemed to work fine until I tried to
override the default timeout in a support file.
The error seems to indicate that the typescript file 'support.ts' is being
#EOF, #Language, #TagLine, #FeatureLine, #Comment, #Empty, got 'import {
setDefaultTimeout} from 'cucumber''
at
/home/me/src/my-stuff/cucumber-ts-node/node_modules/cucumber/src/cli/helpers.js:66:13
at Array.forEach (<anonymous>)
at
/home/me/src/my-stuff/cucumber-ts-node/node_modules/cucumber/src/cli/helpers.js:54:10
at Generator.next (<anonymous>)
at Generator.tryCatcher
(/home/me/src/my-stuff/cucumber-ts-node/node_modules/bluebird/js/release/util.js:16:23)
at PromiseSpawn._promiseFulfilled
(/home/me/src/my-stuff/cucumber-ts-node/node_modules/bluebird/js/release/generators.js:97:49)
at
/home/me/src/my-stuff/cucumber-ts-node/node_modules/bluebird/js/release/generators.js:201:15
at getTestCases
(/home/me/src/my-stuff/cucumber-ts-node/node_modules/cucumber/lib/cli/helpers.js:102:18)
at
/home/me/src/my-stuff/cucumber-ts-node/node_modules/cucumber/src/cli/helpers.js:32:13
at Generator.next (<anonymous>)
at Generator.tryCatcher
(/home/me/src/my-stuff/cucumber-ts-node/node_modules/bluebird/js/release/util.js:16:23)
at PromiseSpawn._promiseFulfilled
(/home/me/src/my-stuff/cucumber-ts-node/node_modules/bluebird/js/release/generators.js:97:49)
at Promise._settlePromise
(/home/me/src/my-stuff/cucumber-ts-node/node_modules/bluebird/js/release/promise.js:574:26)
at Promise._settlePromise0
(/home/me/src/my-stuff/cucumber-ts-node/node_modules/bluebird/js/release/promise.js:614:10)
at Promise._settlePromises
(/home/me/src/my-stuff/cucumber-ts-node/node_modules/bluebird/js/release/promise.js:693:18)
at Async._drainQueue
(/home/me/src/my-stuff/cucumber-ts-node/node_modules/bluebird/js/release/async.js:133:16)
npm ERR! Test failed. See above for more details.
https://github.com/gforceg/ts-cucumberjs-timeout-problem
There is probably something simple that I'm missing but I haven't found a
solution in prior issues / documentation yet.
Thanks.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
g***@gmail.com
2018-05-05 17:30:12 UTC
Reply
Permalink
Raw Message
Post by g***@gmail.com
Hello,
I'm using cucumber-js and everything seemed to work fine until I tried to
override the default timeout in a support file.
The error seems to indicate that the typescript file 'support.ts' is being
#EOF, #Language, #TagLine, #FeatureLine, #Comment, #Empty, got 'import {
setDefaultTimeout} from 'cucumber''
at
/home/me/src/my-stuff/cucumber-ts-node/node_modules/cucumber/src/cli/helpers.js:66:13
at Array.forEach (<anonymous>)
at
/home/me/src/my-stuff/cucumber-ts-node/node_modules/cucumber/src/cli/helpers.js:54:10
at Generator.next (<anonymous>)
at Generator.tryCatcher
(/home/me/src/my-stuff/cucumber-ts-node/node_modules/bluebird/js/release/util.js:16:23)
at PromiseSpawn._promiseFulfilled
(/home/me/src/my-stuff/cucumber-ts-node/node_modules/bluebird/js/release/generators.js:97:49)
at
/home/me/src/my-stuff/cucumber-ts-node/node_modules/bluebird/js/release/generators.js:201:15
at getTestCases
(/home/me/src/my-stuff/cucumber-ts-node/node_modules/cucumber/lib/cli/helpers.js:102:18)
at
/home/me/src/my-stuff/cucumber-ts-node/node_modules/cucumber/src/cli/helpers.js:32:13
at Generator.next (<anonymous>)
at Generator.tryCatcher
(/home/me/src/my-stuff/cucumber-ts-node/node_modules/bluebird/js/release/util.js:16:23)
at PromiseSpawn._promiseFulfilled
(/home/me/src/my-stuff/cucumber-ts-node/node_modules/bluebird/js/release/generators.js:97:49)
at Promise._settlePromise
(/home/me/src/my-stuff/cucumber-ts-node/node_modules/bluebird/js/release/promise.js:574:26)
at Promise._settlePromise0
(/home/me/src/my-stuff/cucumber-ts-node/node_modules/bluebird/js/release/promise.js:614:10)
at Promise._settlePromises
(/home/me/src/my-stuff/cucumber-ts-node/node_modules/bluebird/js/release/promise.js:693:18)
at Async._drainQueue
(/home/me/src/my-stuff/cucumber-ts-node/node_modules/bluebird/js/release/async.js:133:16)
npm ERR! Test failed. See above for more details.
https://github.com/gforceg/ts-cucumberjs-timeout-problem
There is probably something simple that I'm missing but I haven't found a
solution in prior issues / documentation yet.
I needed to wrap my require glob in single quotes. I wouldn't have figured
this out if I hadn't found issue #1040
<https://github.com/cucumber/cucumber-js/issues/1040>
My test script in package.json now reads:
cucumber-js features --require-module ts-node/register --require
'features/**/*.ts'
Post by g***@gmail.com
Thanks.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...