๋ง์ ์์ ์ฝ๊ธฐ/๊ฒ์ ํ์๋ Typescript๋ก ์ค์ด-js๋ฅผ ์ผ๋ง๋ ์ ํํ๊ฒ ์คํํ ์ ์๋์ง์ ๋ํด ์ฌ์ ํ ๋จธ๋ฆฌ๋ฅผ ๊ฐ์ ์ ์์ต๋๋ค. --compiler
๊ฐ --require-module
๋ฅผ ์ํด ์ ๊ฑฐ๋์๋ค๋ ๊ฒ์ ์ดํดํ์ง๋ง ๊ฐ๋จํ ์ค์ด-js + typescript(๊ฐ๋๊ธฐ, Nightwatch ๋๋ ๋ค๋ฅธ ํ
์คํธ ํ๋ ์์ํฌ๊ฐ ์๋)๋ฅผ ์ฌ์ฉํ์ฌ ์ค๋ช
ํ๋ ๊ตฌ์ฒด์ ์ธ ์๋ฅผ ์ฐพ์ง ๋ชปํ์ต๋๋ค. ๊ณผ์ .
cucumber-js
์ฑ์ ์ด๋ป๊ฒ ์คํํ ๊น์?์ง๊ธ์ package.json์์ cucumber-js --require-module ts-node/register
๋ฅผ ์ฌ์ฉํ๊ณ ์์ต๋๋ค(cucumber-js๋ ์ ์ญ์ ์ผ๋ก ์ค์น๋์ง ์๊ณ ๋ก์ปฌ๋ก ์ค์น๋จ), ์ด๊ฒ์ด ๋ง์ต๋๊น?
support
๋ฐ step_definitions
๋ด๋ถ์ ๋ช
์์ ์ผ๋ก --require
์ฒ๋ฆฌํด์ผ ํฉ๋๊น?์ง๊ธ ๋ด ํด๋ ๊ตฌ์กฐ๋ ๋ค์๊ณผ ๊ฐ์ต๋๋ค.
- [root app folder]
-- package.json
-- features/
---- myExample.feature
---- step_definitions/
------ myExample.ts
---- support/
------ customWorld.ts
ํ ์คํธ๋ฅผ ์คํํ ๋ ๋ด ๊ธฐ๋ฅ ํ์ผ์ ๋ชจ๋ ๋จ๊ณ๊ฐ ์ ์๋์ง ์์์์ ์ง์ ํ๋ ์ถ๋ ฅ์ด ํ์๋ฉ๋๋ค. ์ด๊ฒ์ด ํธ๋์คํ์ผ๋ง ๋ฌธ์ ์ผ ์ ์๋ค๊ณ ์๊ฐํ์ง๋ง ํ์คํ์ง ์์ต๋๋ค.
์๋ ํ์ธ์ @Niceplace , ์ด cucumber-ts-starter
@Niceplace ์ด ๋ฌธ์๋ฅผ ๋ณด์์ต๋๊น? https://github.com/cucumber/cucumber-js/blob/e149ee3644f57d788483390e46d8a60fd8db886c/docs/cli.md#transpilers ?
์ง๊ธ์ ๋ฌธ์ ๋ซ์ต๋๋ค. ๋ฌธ์๋ฅผ ๋ ์ ๊ตฌ์ฑํ ์ ์๋ค๊ณ ์๊ฐ๋๋ฉด ๋ค์ ์ด์ด์ฃผ์ธ์. ํธ๋์คํ์ผ๋ฌ์ ์ต์์ ๋งํฌ๋ฅผ ์ถ๊ฐํด์ผ ํ ๊น์?
์ด ์ค๋ ๋๋ ๋ซํ ํ ์ต๊ทผ ํ๋์ด ์์๊ธฐ ๋๋ฌธ์ ์๋์ผ๋ก ์ ๊ฒผ์ต๋๋ค. ๊ด๋ จ ๋ฒ๊ทธ์ ๋ํ ์ ๋ฌธ์ ๋ฅผ ์ฌ์ญ์์ค.
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
์๋ ํ์ธ์ @Niceplace , ์ด cucumber-ts-starter