-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
36 lines (32 loc) · 848 Bytes
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
const assert = require('assert')
const { part1, part2 } = require('./script')
const numbers =
`1721
979
366
299
675
1456`
const badData =
`120
500
600
800`
describe('Day 1: Report Repair', () => {
describe('Part One', () => {
it('should return the product of 2 numbers which sum to 2020', () => {
assert.strictEqual(part1(numbers), 514579)
})
it('should return null if no correct answer is found', () => {
assert.strictEqual(part1(badData), null)
})
})
describe('Part Two', () => {
it('should return the product of 3 numbers which sum to 2020', () => {
assert.strictEqual(part2(numbers), 241861950)
})
it('should return null if no correct answer is found', () => {
assert.strictEqual(part2(badData), null)
})
})
})