unittest / unit test / jest / js unittest / vuejs unit test
vuejs2 unit test 에 jest 사용법
절차
npm i -D jest*.spec.js생성,*.test.js도 가능npm run test생성,package.jsonnpm run test
*.spec.js 생성
아래처럼 apis.js 가 있을때, apis.spec.js 를
만들고, jest 를 run 하면 jest 가 .spec.js 들을 가져다
실행하게 된다.
- <myproj>/
- apis.js
- apis.spec.js
npm run test
// package.json
{
...
"scripts": {
"test": "jest",
...
npm run test
댓글 없음:
댓글 쓰기