Fix testing output
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import { describe, expect, it } from 'bun:test';
|
import { describe, expect, it } from 'bun:test';
|
||||||
import { solveFirst, solveSecond } from './index.ts';
|
import { solveFirst } from './index.ts';
|
||||||
|
|
||||||
describe('2023-25', () => {
|
describe('2023-25', () => {
|
||||||
it('first', () => {
|
it('first', () => {
|
||||||
@@ -18,10 +18,4 @@ rzs: qnr cmg lsr rsh
|
|||||||
frs: qnr lhk lsr`;
|
frs: qnr lhk lsr`;
|
||||||
expect(solveFirst(testInput)).toBe(54);
|
expect(solveFirst(testInput)).toBe(54);
|
||||||
});
|
});
|
||||||
it('second', () => {
|
|
||||||
// TODO: add second input
|
|
||||||
const testInput = ``;
|
|
||||||
// TODO: add second solution
|
|
||||||
expect(solveSecond(testInput)).toBe(0);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|||||||
+2
-6
@@ -73,13 +73,9 @@ export function solveFirst(input: string): number {
|
|||||||
mult = result.mult;
|
mult = result.mult;
|
||||||
} while (edgeLength > 3);
|
} while (edgeLength > 3);
|
||||||
|
|
||||||
|
if (process.env.NODE_ENV !== 'test') {
|
||||||
console.log(`That took ${i} tries`);
|
console.log(`That took ${i} tries`);
|
||||||
console.log(mult);
|
console.log(mult);
|
||||||
|
}
|
||||||
return mult;
|
return mult;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function solveSecond(input: string): number {
|
|
||||||
// TODO: add code
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|||||||
+1
-5
@@ -1,12 +1,8 @@
|
|||||||
import { join } from 'path';
|
import { join } from 'path';
|
||||||
import { solveFirst, solveSecond } from './index.ts';
|
import { solveFirst } from './index.ts';
|
||||||
|
|
||||||
const input = await Bun.file(join(__dirname, 'input.txt')).text();
|
const input = await Bun.file(join(__dirname, 'input.txt')).text();
|
||||||
|
|
||||||
const firstAnswer = solveFirst(input);
|
const firstAnswer = solveFirst(input);
|
||||||
|
|
||||||
console.log(firstAnswer);
|
console.log(firstAnswer);
|
||||||
|
|
||||||
const secondAnswer = solveSecond(input);
|
|
||||||
|
|
||||||
console.log(secondAnswer);
|
|
||||||
|
|||||||
@@ -13,5 +13,8 @@ describe('2024-02', () => {
|
|||||||
});
|
});
|
||||||
it('second', () => {
|
it('second', () => {
|
||||||
expect(solveSecond(testInput)).toBe(4);
|
expect(solveSecond(testInput)).toBe(4);
|
||||||
|
expect(solveSecond(testInput)).toBeGreaterThanOrEqual(
|
||||||
|
solveFirst(testInput)
|
||||||
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user