-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.js
31 lines (27 loc) · 857 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
const assert = require('assert');
const partOne = require('./partOne');
const partTwo = require('./partTwo');
describe('Day 4: High-Entropy Passphrases', () => {
describe('Part 1', () => {
it('should count 2 valid passphrases', () => {
const PASSPHRASES = [
['aa', 'bb', 'cc', 'dd', 'ee'],
['aa', 'bb', 'cc', 'dd', 'aa'],
['aa', 'bb', 'cc', 'dd', 'aaa']
];
assert.strictEqual(2, partOne(PASSPHRASES));
});
});
describe('Part 2', () => {
it('should count 3 valid passphrases', () => {
const PASSPHRASES = [
['abcde', 'fghij'],
['abcde', 'xyz', 'ecdab'],
['a', 'ab', 'abc', 'abd', 'abf', 'abj'],
['iiii', 'oiii', 'ooii', 'oooi', 'oooo'],
['oiii', 'ioii', 'iioi', 'iiio']
];
assert.strictEqual(3, partTwo(PASSPHRASES));
});
});
});