인프런 영문 브랜드 로고
인프런 영문 브랜드 로고

인프런 커뮤니티 질문&답변

mozzzi.__님의 프로필 이미지

작성한 질문수

테스트 with Jest: 제로초에게 제대로 배우기

jest 설치 및 ESM 세팅

npx cross-env NODE_OPTIONS="$NODE_OPTIONS --experimental-vm-modules" jest 터미널 에러

작성

·

88

0

명령어를 아래처럼 치면 이렇게 나와요. 어디가 문제일지 ..

npx cross-env NODE_OPTIONS="$NODE_OPTIONS --experimental-vm-modules" jest

 

터미널내용:

No tests found, exiting with code 1

Run with --passWithNoTests to exit with code 0

In C:\Users\hyesu\Desktop\works\jest-test

3 files checked.

testMatch: /__tests__//*.[jt]s?(x), **/?(*.)+(spec|test).[tj]s?(x) - 0 matches

testPathIgnorePatterns: \\node_modules\\ - 3 matches

testRegex: - 0 matches

Pattern: - 0 matches



toBe.js

export default function sum(x, y) { return x + y; }

 

package.json

{
  "name": "jest-test",
  "version": "1.0.0",
  "main": "index.js",
  "type": "module",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "description": "",
  "devDependencies": {
    "cross-env": "^7.0.3",
    "jest": "^29.7.0"
  }
}

답변 1

0

mozzzi.__님의 프로필 이미지
mozzzi.__
질문자

아 찾았습니다. toBe.spec.js를 잊어서 난 에러였네요