Skip to content

Commit 9766396

Browse files
Fix tests
1 parent f7f8231 commit 9766396

4 files changed

Lines changed: 11 additions & 6 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33

44
node_modules
55
/dist
6+
coverage

package-lock.json

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@
4141
"build:types": "tsc -p tsconfig.dec.json --emitDeclarationOnly && find ./dist -name '*.d.ts' -exec sh -c 'cp {} $(dirname {})/$(basename -s .d.ts {}).d.cts' \\;",
4242
"clean": "rm -rf ./dist",
4343
"format": "prettier --write \"{{source,test}/**/*.{js,ts},rollup.config.js,vitest.config.js}\"",
44+
"test": "npm run test:specs && npm run test:format && npm run test:types",
4445
"test:format": "prettier --check \"{{source,test}/**/*.{js,ts},rollup.config.js,vitest.config.js}\"",
45-
"test:specs": "vitest",
46+
"test:specs": "npm run build && vitest",
4647
"test:types": "npx --yes @arethetypeswrong/cli --pack ."
4748
},
4849
"files": [

test/node/crockford.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@ import { incrementBase32 } from "../../";
44
describe("incrementBase32", () => {
55
it("increments correctly", () => {
66
expect(incrementBase32("A109C")).toEqual("A109D");
7-
})
7+
});
88

99
it("carries correctly", () => {
1010
expect(incrementBase32("A1YZZ")).toEqual("A1Z00");
11-
})
11+
});
1212

1313
it("double increments correctly", () => {
1414
expect(incrementBase32(incrementBase32("A1YZZ"))).toEqual("A1Z01");
15-
})
15+
});
1616

1717
it("throws when it cannot increment", () => {
1818
expect(() => {
19-
incrementBase32("ZZZ")
19+
incrementBase32("ZZZ");
2020
}).toThrow(/B32_ENC_INVALID/);
21-
})
21+
});
2222
});

0 commit comments

Comments
 (0)