Skip to content

Commit

Permalink
feat: 更新单测
Browse files Browse the repository at this point in the history
  • Loading branch information
whyrove committed Jan 20, 2025
1 parent 71166a4 commit 2840d03
Show file tree
Hide file tree
Showing 45 changed files with 840 additions and 11 deletions.
412 changes: 402 additions & 10 deletions backstop.json

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"test": "jest --no-cache",
"ci:test": "pnpm run test --coverage",
"ci:eslint": "pnpm run lint:script -- -f json -o ./.ci/eslint.json",
"ui:test": "dumi dev & chmod +x ./scripts/ui-test.sh && ./scripts/ui-test.sh",
"ui:test": "chmod +x ./scripts/ui-test.sh && ./scripts/ui-test.sh",
"generate:mini:files": "node scripts/mini-program-site/generateMiniFiles.js",
"lint": "pnpm run lint:script && pnpm run lint:style",
"lint:script": "eslint ./packages --ext .js,.jsx,.ts,.tsx",
Expand Down
25 changes: 25 additions & 0 deletions scripts/backstop.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
const path = require('path');
const fs = require("fs-extra");

const coreDir = path.resolve(__dirname, '../packages/bui-core/src/index.ts');

const transformComponentName = (name) => {
const newName = name[0].toLowerCase() + name.slice(1);
return newName.replace(/([A-Z])/gm, `-$1`).toLowerCase()
}
const components = fs.readFileSync(coreDir, 'utf8')?.match(/(?<=export \* from '\.\/).*?(?=';$)/gm);
const test = components.map(item => {
return {
label: item,
url: `http://localhost/cores/${transformComponentName(item)}`,
referenceUrl: `https://bui.taopiaopiao.com/cores/${transformComponentName(item)}`,
readySelector: ".dumi-default-previewer-demo",
delay: 0,
selectorExpansion: true,
misMatchThreshold: 0.1,
requireSameDimensions: true
}
})

console.log(test, "测试")

Loading

0 comments on commit 2840d03

Please sign in to comment.