-
Notifications
You must be signed in to change notification settings - Fork 284
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(utils): [grid,select] add vitest for utils package (#2813)
* test(utils): add vitest for utils package * fix(log): fix * fix(xss): fix * fix(grid): add dependence * fix(grid): fix e2e test * fix(test): fix
- Loading branch information
1 parent
9ed39c7
commit 312dbcf
Showing
21 changed files
with
70 additions
and
788 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
# @opentiny/utils | ||
## 安装 | ||
|
||
```bash | ||
npm install --save @opentiny/utils | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
{ | ||
"name": "@opentiny/utils", | ||
"type": "module", | ||
"version": "1.0.0", | ||
"description": "nanoid console xss", | ||
"author": "", | ||
"license": "ISC", | ||
"type": "module", | ||
"repository": { | ||
"type": "git", | ||
"url": "[email protected]:opentiny/tiny-vue.git" | ||
|
@@ -16,14 +16,16 @@ | |
], | ||
"scripts": { | ||
"build": "vite build", | ||
"pub": "pnpm publish --no-git-checks --access=public" | ||
"pub": "pnpm publish --no-git-checks --access=public", | ||
"test": "vitest" | ||
}, | ||
"dependencies": { | ||
"xss": "1.0.14" | ||
}, | ||
"devDependencies": { | ||
"typescript": "catalog:", | ||
"vite": "catalog:", | ||
"vite-plugin-dts": "~4.3.0", | ||
"vite": "catalog:" | ||
"vitest": "catalog:" | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
packages/utils/src/crypt/__test__/__snapshots__/crypt.test.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html | ||
|
||
exports[`测试sha256 1`] = `"b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9"`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { test, expect } from 'vitest' | ||
import { sha256 } from '../index' | ||
|
||
test('测试sha256', async () => { | ||
// 简单记录加密的结果,测试用来保证sha256算法不变化 | ||
expect(await sha256('hello world')).toMatchSnapshot() | ||
}) |
Oops, something went wrong.