Skip to content

Commit

Permalink
test: setup basic test cases (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiahan authored Oct 14, 2024
1 parent 95956a4 commit 058e447
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ jobs:
run: pnpm install && npx playwright install

- name: Run Test
run: pnpm run build
run: pnpm run build && pnpm run test
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"lint": "biome check .",
"lint:write": "biome check . --write",
"prepare": "simple-git-hooks && npm run build",
"test": "playwright test",
"test": "node test/index.js",
"bump": "npx bumpp"
},
"simple-git-hooks": {
Expand Down
17 changes: 17 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import assert from 'node:assert';
import test from 'node:test';
import {
checkCancel,
create,
multiselect,
select,
text,
} from '../dist/index.js';

test('should export public APIs', () => {
assert.deepStrictEqual(typeof checkCancel, 'function');
assert.deepStrictEqual(typeof create, 'function');
assert.deepStrictEqual(typeof multiselect, 'function');
assert.deepStrictEqual(typeof select, 'function');
assert.deepStrictEqual(typeof text, 'function');
});

0 comments on commit 058e447

Please sign in to comment.