Skip to content

Commit

Permalink
chore: change some assertions to make it bun compatible, might not be…
Browse files Browse the repository at this point in the history
… necessary as bun evolves
  • Loading branch information
AlexAegis committed Dec 1, 2023
1 parent 3fa7f52 commit 160dc4c
Show file tree
Hide file tree
Showing 279 changed files with 923 additions and 958 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import { runner } from '../part_one';
describe(`${year} - Day ${day} - Part One`, () => {
it(`should resolve to ${results.one.input} when using the input`, async () => {
const resources = await loadTaskResources(packageJson.aoc);
expect(runner(input.input)).to.equal(Infinity);
expect(runner(input.input)).toEqual(Infinity);
});

it('should be that that both the first examples resolves to 0', async () => {
expect(await runner('')).to.equal(0);
expect(await runner('')).toEqual(0);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import { runner } from '../part_two';
describe('${year} - Day ${day} - Part Two', () => {
it('should solve for the input', async () => {
const resources = await loadTaskResources(packageJson.aoc);
expect(runner(input.input)).to.equal(Infinity);
expect(runner(input.input)).toEqual(Infinity);
});

it('should be that that the first example resolves to 0', async () => {
expect(await runner('0')).to.equal(0);
expect(await runner('0')).toEqual(0);
});
});
20 changes: 10 additions & 10 deletions solutions/typescript/2015/01/src/p1.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,27 @@ import { p1 } from './p1.js';
describe('2015 - Day 1 - Part One', () => {
it('should solve the input', async () => {
const resources = await loadTaskResources(packageJson.aoc);
expect(p1(resources.input)).to.equal(74);
expect(p1(resources.input)).toEqual(74);
});

it('should be that that both the first examples resolves to 0', () => {
expect(p1('(())')).to.equal(0);
expect(p1('()()')).to.equal(0);
expect(p1('(())')).toEqual(0);
expect(p1('()()')).toEqual(0);
});

it('should be that that both the second and the third examples resolves to 3', () => {
expect(p1('(((')).to.equal(3);
expect(p1('(()(()(')).to.equal(3);
expect(p1('))(((((')).to.equal(3);
expect(p1('(((')).toEqual(3);
expect(p1('(()(()(')).toEqual(3);
expect(p1('))(((((')).toEqual(3);
});

it('should be that that both the fourth examples resolves to -1', () => {
expect(p1('())')).to.equal(-1);
expect(p1('))(')).to.equal(-1);
expect(p1('())')).toEqual(-1);
expect(p1('))(')).toEqual(-1);
});

it('should be that that both the fith examples resolves to -3', () => {
expect(p1(')))')).to.equal(-3);
expect(p1(')())())')).to.equal(-3);
expect(p1(')))')).toEqual(-3);
expect(p1(')())())')).toEqual(-3);
});
});
6 changes: 3 additions & 3 deletions solutions/typescript/2015/01/src/p2.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import { p2 } from './p2.js';
describe('2015 - Day 1 - Part Two', () => {
it('should solve the input', async () => {
const resources = await loadTaskResources(packageJson.aoc);
expect(p2(resources.input)).to.equal(1795);
expect(p2(resources.input)).toEqual(1795);
});

it('should be that that the first example resolves to 1', () => {
expect(p2(')')).to.equal(1);
expect(p2(')')).toEqual(1);
});

it('should be that that the second example resolves to 5', () => {
expect(p2('()())')).to.equal(5);
expect(p2('()())')).toEqual(5);
});
});
6 changes: 3 additions & 3 deletions solutions/typescript/2015/02/src/p1.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import { p1 } from './p1.js';
describe('2015 - Day 2 - Part One', () => {
it('should resolve to 1606483 when using the input', async () => {
const resources = await loadTaskResources(packageJson.aoc);
expect(p1(resources.input)).to.equal(1_606_483);
expect(p1(resources.input)).toEqual(1_606_483);
});

it('should be that that the first example resolves to 58', () => {
expect(p1('2x3x4')).to.equal(58);
expect(p1('2x3x4')).toEqual(58);
});

it('should be that that the second example resolves to 43', () => {
expect(p1('1x1x10')).to.equal(43);
expect(p1('1x1x10')).toEqual(43);
});
});
6 changes: 3 additions & 3 deletions solutions/typescript/2015/02/src/p2.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import { p2 } from './p2.js';
describe('2015 - Day 2 - Part Two', () => {
it('should solve the input', async () => {
const resources = await loadTaskResources(packageJson.aoc);
expect(p2(resources.input)).to.equal(3_842_356);
expect(p2(resources.input)).toEqual(3_842_356);
});

it('should be that that the first example resolves to 34', () => {
expect(p2('2x3x4')).to.equal(34);
expect(p2('2x3x4')).toEqual(34);
});

it('should be that that the second example resolves to 14', () => {
expect(p2('1x1x10')).to.equal(14);
expect(p2('1x1x10')).toEqual(14);
});
});
8 changes: 4 additions & 4 deletions solutions/typescript/2015/03/src/p1.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ import { p1 } from './p1.js';
describe('2015 - Day 3 - Part One', () => {
it('should resolve to 2572 when using the input', async () => {
const resources = await loadTaskResources(packageJson.aoc);
expect(p1(resources.input)).to.equal(2572);
expect(p1(resources.input)).toEqual(2572);
});

it('should be that that the first example resolves to 2', () => {
expect(p1('>')).to.equal(2);
expect(p1('>')).toEqual(2);
});

it('should be that that the second example resolves to 4', () => {
expect(p1('^>v<')).to.equal(4);
expect(p1('^>v<')).toEqual(4);
});

it('should be that that the third example resolves to 2', () => {
expect(p1('^v^v^v^v^v')).to.equal(2);
expect(p1('^v^v^v^v^v')).toEqual(2);
});
});
8 changes: 4 additions & 4 deletions solutions/typescript/2015/03/src/p2.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ import { p2 } from './p2.js';
describe('2015 - Day 3 - Part Two', () => {
it('should solve the input', async () => {
const resources = await loadTaskResources(packageJson.aoc);
expect(p2(resources.input)).to.equal(2631);
expect(p2(resources.input)).toEqual(2631);
});

it('should be that that the first example resolves to 3', () => {
expect(p2('^v')).to.equal(3);
expect(p2('^v')).toEqual(3);
});

it('should be that that the second example resolves to 3', () => {
expect(p2('^>v<')).to.equal(3);
expect(p2('^>v<')).toEqual(3);
});

it('should be that that the third example resolves to 11', () => {
expect(p2('^v^v^v^v^v')).to.equal(11);
expect(p2('^v^v^v^v^v')).toEqual(11);
});
});
6 changes: 3 additions & 3 deletions solutions/typescript/2015/04/src/p1.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe('2015 - Day 4 - Part One', () => {
'should resolve to 346386 when using the input',
async () => {
const resources = await loadTaskResources(packageJson.aoc);
expect(p1(resources.input)).to.equal(346_386);
expect(p1(resources.input)).toEqual(346_386);
},
{ timeout: 20_000 },
);
Expand All @@ -17,7 +17,7 @@ describe('2015 - Day 4 - Part One', () => {
'should resolve to 609043 when using the example',
async () => {
const resources = await loadTaskResources(packageJson.aoc, 'example.txt');
expect(p1(resources.input)).to.equal(609_043);
expect(p1(resources.input)).toEqual(609_043);
},
{ timeout: 20_000 },
);
Expand All @@ -26,7 +26,7 @@ describe('2015 - Day 4 - Part One', () => {
'should resolve to 1048970 when using the second example',
async () => {
const resources = await loadTaskResources(packageJson.aoc, 'example.2.txt');
expect(p1(resources.input)).to.equal(1_048_970);
expect(p1(resources.input)).toEqual(1_048_970);
},
{ timeout: 20_000 },
);
Expand Down
6 changes: 3 additions & 3 deletions solutions/typescript/2015/04/src/p2.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe('2015 - Day 4 - Part Two', () => {
'should solve the input',
async () => {
const resources = await loadTaskResources(packageJson.aoc);
expect(p2(resources.input)).to.equal(9_958_218);
expect(p2(resources.input)).toEqual(9_958_218);
},
{ timeout: 20_000 },
);
Expand All @@ -17,7 +17,7 @@ describe('2015 - Day 4 - Part Two', () => {
'should resolve to 6742839 when using the example',
async () => {
const resources = await loadTaskResources(packageJson.aoc, 'example.txt');
expect(p2(resources.input)).to.equal(6_742_839);
expect(p2(resources.input)).toEqual(6_742_839);
},
{ timeout: 20_000 },
);
Expand All @@ -26,7 +26,7 @@ describe('2015 - Day 4 - Part Two', () => {
'should resolve to 5714438 when using the example',
async () => {
const resources = await loadTaskResources(packageJson.aoc, 'example.2.txt');
expect(p2(resources.input)).to.equal(5_714_438);
expect(p2(resources.input)).toEqual(5_714_438);
},
{ timeout: 20_000 },
);
Expand Down
12 changes: 6 additions & 6 deletions solutions/typescript/2015/05/src/p1.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,26 @@ import { isNice, p1 } from './p1.js';
describe('2015 - Day 5 - Part One', () => {
it('should resolve to 236 when using the input', async () => {
const resources = await loadTaskResources(packageJson.aoc);
expect(p1(resources.input)).to.equal(236);
expect(p1(resources.input)).toEqual(236);
});

it('should true that example 1 is nice', () => {
expect(isNice('ugknbfddgicrmopn')).to.equal(true);
expect(isNice('ugknbfddgicrmopn')).toEqual(true);
});

it('should true that example 2 is nice', () => {
expect(isNice('aaa')).to.equal(true);
expect(isNice('aaa')).toEqual(true);
});

it('should true that example 3 is naughty', () => {
expect(isNice('jchzalrnumimnmhp')).to.equal(false);
expect(isNice('jchzalrnumimnmhp')).toEqual(false);
});

it('should true that example 4 is naughty', () => {
expect(isNice('haegwjzuvuyypxyu')).to.equal(false);
expect(isNice('haegwjzuvuyypxyu')).toEqual(false);
});

it('should true that example 5 is naughty', () => {
expect(isNice('dvszwmarrgswjxmb')).to.equal(false);
expect(isNice('dvszwmarrgswjxmb')).toEqual(false);
});
});
10 changes: 5 additions & 5 deletions solutions/typescript/2015/05/src/p2.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ import { isNice, p2 } from './p2.js';
describe('2015 - Day 5 - Part Two', () => {
it('should solve the input', async () => {
const resources = await loadTaskResources(packageJson.aoc);
expect(p2(resources.input)).to.equal(51);
expect(p2(resources.input)).toEqual(51);
});

it('should true that example 1 is nice', () => {
expect(isNice('qjhvhtzxzqqjkmpb')).to.equal(true);
expect(isNice('qjhvhtzxzqqjkmpb')).toEqual(true);
});

it('should true that example 2 is nice', () => {
expect(isNice('xxyxx')).to.equal(true);
expect(isNice('xxyxx')).toEqual(true);
});

it('should true that example 3 is naughty', () => {
expect(isNice('uurcxstgmygtbstg')).to.equal(false);
expect(isNice('uurcxstgmygtbstg')).toEqual(false);
});

it('should true that example 4 is naughty', () => {
expect(isNice('ieodomkazucvgmuy')).to.equal(false);
expect(isNice('ieodomkazucvgmuy')).toEqual(false);
});
});
8 changes: 4 additions & 4 deletions solutions/typescript/2016/01/src/p1.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ import { p1 } from './p1.js';
describe('2016 - Day 1 - Part One', () => {
it('should resolve to 300 when using the input', async () => {
const resources = await loadTaskResources(packageJson.aoc);
expect(p1(resources.input)).to.equal(300);
expect(p1(resources.input)).toEqual(300);
});

it('should be that that the first example resolves to 5', () => {
expect(p1('R2, L3')).to.equal(5);
expect(p1('R2, L3')).toEqual(5);
});

it('should be that that the second example resolves to 2', () => {
expect(p1('R2, R2, R2')).to.equal(2);
expect(p1('R2, R2, R2')).toEqual(2);
});

it('should be that that the third example resolves to 12', () => {
expect(p1('R5, L5, R5, R3')).to.equal(12);
expect(p1('R5, L5, R5, R3')).toEqual(12);
});
});
4 changes: 2 additions & 2 deletions solutions/typescript/2016/01/src/p2.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import { p2 } from './p2.js';
describe('2016 - Day 1 - Part Two', () => {
it('should solve the input', async () => {
const resources = await loadTaskResources(packageJson.aoc);
expect(p2(resources.input)).to.equal(159);
expect(p2(resources.input)).toEqual(159);
});

it('should be that that the example resolves to 4', () => {
expect(p2('R8, R4, R4, R8')).to.equal(4);
expect(p2('R8, R4, R4, R8')).toEqual(4);
});
});
4 changes: 2 additions & 2 deletions solutions/typescript/2016/02/src/p1.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import { p1 } from './p1.js';
describe('2016 - Day 2 - Part One', () => {
it('should resolve to 24862 when using the input', async () => {
const resources = await loadTaskResources(packageJson.aoc);
expect(p1(resources.input)).to.equal(24_862);
expect(p1(resources.input)).toEqual(24_862);
});

it('should be that that the first example resolves to 1985', async () => {
const resources = await loadTaskResources(packageJson.aoc, 'example.1.txt');
expect(p1(resources.input)).to.equal(1985);
expect(p1(resources.input)).toEqual(1985);
});
});
4 changes: 2 additions & 2 deletions solutions/typescript/2016/02/src/p2.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import { p2 } from './p2.js';
describe('2016 - Day 2 - Part Two', () => {
it('should solve the input', async () => {
const resources = await loadTaskResources(packageJson.aoc);
expect(p2(resources.input)).to.equal('46C91');
expect(p2(resources.input)).toEqual('46C91');
});

it('should be that that the first example resolves to 5DB3', async () => {
const resources = await loadTaskResources(packageJson.aoc, 'example.1.txt');
expect(p2(resources.input)).to.equal('5DB3');
expect(p2(resources.input)).toEqual('5DB3');
});
});
2 changes: 1 addition & 1 deletion solutions/typescript/2016/03/src/p1.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ import { p1 } from './p1.js';
describe('2016 - Day 3 - Part One', () => {
it('should solve the input', async () => {
const resources = await loadTaskResources(packageJson.aoc);
expect(p1(resources.input)).to.equal(869);
expect(p1(resources.input)).toEqual(869);
});
});
2 changes: 1 addition & 1 deletion solutions/typescript/2016/03/src/p2.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ import { p2 } from './p2.js';
describe('2016 - Day 3 - Part Two', () => {
it('should solve the input', async () => {
const resources = await loadTaskResources(packageJson.aoc);
expect(p2(resources.input)).to.equal(1544);
expect(p2(resources.input)).toEqual(1544);
});
});
10 changes: 5 additions & 5 deletions solutions/typescript/2017/01/src/p1.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ import { p1 } from './p1.js';
describe('2017 - Day 1 - Part One', () => {
it('should resolve to 1177 when using the input', async () => {
const resources = await loadTaskResources(packageJson.aoc);
expect(p1(resources.input)).to.equal(1177);
expect(p1(resources.input)).toEqual(1177);
});

it('should be that that the first example resolves to 3', () => {
expect(p1('1122')).to.equal(3);
expect(p1('1122')).toEqual(3);
});

it('should be that that the second example resolves to 3', () => {
expect(p1('1111')).to.equal(4);
expect(p1('1111')).toEqual(4);
});

it('should be that that the third example resolves to 0', () => {
expect(p1('1234')).to.equal(0);
expect(p1('1234')).toEqual(0);
});

it('should be that that the fourth example resolves to 9', () => {
expect(p1('91212129')).to.equal(9);
expect(p1('91212129')).toEqual(9);
});
});
Loading

0 comments on commit 160dc4c

Please sign in to comment.