assert
assert 모듈이 지원하는 함수 목록 (node REPL 에서 실행, ctrl+D: exit)
$node
> require('assert')
{ [Function: ok]
fail: [Function: fail],
AssertionError: [Function: AssertionError],
ok: [Circular],
equal: [Function: equal],
notEqual: [Function: notEqual],
deepEqual: [Function: deepEqual],
deepStrictEqual: [Function: deepStrictEqual],
notDeepEqual: [Function: notDeepEqual],
notDeepStrictEqual: [Function: notDeepStrictEqual],
strictEqual: [Function: strictEqual],
notStrictEqual: [Function: notStrictEqual],
throws: [Function: throws],
doesNotThrow: [Function: doesNotThrow],
ifError: [Function: ifError] }기본예제
심화예제
심화예제 - 실행
첫 번째 오류 발생
두 번째 오류 발생
오류 발생 지점
세 번째 오류 발생
오류 발생 지점
수정 후 다시 실행
assert의 문제점
Last updated