더북(TheBook)
describe('verifier', () => {
    const TODAY = moment().day();

    // 이 테스트는 항상 실행되지만, 아무것도 수행하지 않을 수 있다.
    test('on weekends, throws exceptions', () => {
        if ([SATURDAY, SUNDAY].includes(TODAY)) { 
            expect(() => verifyPassword('anything', [])).toThrowError(
                "It's the weekend!"
            );
        }
    });

    // 이 테스트는 주말에만 실행된다.
    if ([SATURDAY, SUNDAY].includes(TODAY)) { 
        test('on a weekend, throws an error', () => {
            expect(() => verifyPassword('anything', [])).toThrow("It's the weekend!");
        });
    }
});

test 내부에서 날짜를 비교한다.

test 외부에서 날짜를 비교한다.

신간 소식 구독하기
뉴스레터에 가입하시고 이메일로 신간 소식을 받아 보세요.