【发布时间】:2020-07-19 08:49:45
【问题描述】:
NPM 脚本:"cucumber": "cucumber-js --require features/tests.setup.js --require features/**/*.ts".
tests.setup.js:
require('ts-node').register({
transpileOnly: true,
compilerOptions: {
"module": "commonjs",
},
});
Gitlab CI 错误:
> cucumber-js --require features/tests.setup.js --require features/**/*.ts
Error: Parse error in 'features/step-definitions/steps.calculus-triangle.ts': (1:1): expected: #EOF, #Language, #TagLine, #FeatureLine, #Comment, #Empty, got 'import {Then} from 'cucumber''
at events.forEach.event (/builds/Ambroise-Rabier/mandala-vibratoire/node_modules/cucumber/lib/cli/helpers.js:110:13)
at Array.forEach (<anonymous>)
at getTestCases (/builds/Ambroise-Rabier/mandala-vibratoire/node_modules/cucumber/lib/cli/helpers.js:81:10)
at _bluebird.default.each (/builds/Ambroise-Rabier/mandala-vibratoire/node_modules/cucumber/lib/cli/helpers.js:58:35)
它在本地工作(win 10),但在 Gitlab CI 上它似乎忽略了打字稿编译。
【问题讨论】:
标签: typescript gitlab-ci cucumberjs