강의

멘토링

커뮤니티

Inflearn Community Q&A

bonosoup's profile image
bonosoup

asked

TDD Development by Following [Updated in November 2023]

Writing integration tests for getProductById (2)

syntax 관련 질문

Written on

·

209

0

const input = 'test';
describe('',()=>{
it("should be return proper result", (input) => {
console.log(input)
}
})
 
궁금해서 해보았는데요,
it 구문에 ()=>{} 매개변수 입력시 테스트 케이스가 정상적으로 작동하지 않습니다.
이유 알 수 있을까요?
mongodbtddnodejsexpresssupertestmongoosejest

Answer 2

0

bonosoup님의 프로필 이미지
bonosoup
Questioner

감사합니다!

0

John Ahn님의 프로필 이미지
John Ahn
Instructor

안녕하세요 

그 부분은 파라미터를 넣는 자리입니다 ! 

describe('', () => {
it("should be return proper result", function name(params) {
 
})
})

 

이런식으로 되는 건데 저기에는 함수를 콜할때 넣어주실수 있는 자리입니다 ~ ! 

 

name("A"); 

이런식으로 name이라는 이름의 함수에 A 인자를 주면 그때 
저 param안에 A를 가져오게 됩니다. 그러기에 위에 작성해주신 input이 에러가 나게 됩니다 ~ 
감사합니다.

 
bonosoup's profile image
bonosoup

asked

Ask a question