Skip to content

Commit bacd2a1

Browse files
committed
feat: use vite testing
1 parent 67be98e commit bacd2a1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+7474
-17938
lines changed

Diff for: .github/workflows/ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ jobs:
3434
run: |
3535
echo "CYPRESS_RECORD_KEY=${{ secrets.CYPRESS_RECORD_KEY }}" >> $GITHUB_ENV
3636
echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
37-
echo "CYPRESS_INSTALL_BINARY=6.0.0" >> $GITHUB_ENV
37+
echo "CYPRESS_INSTALL_BINARY=13.14.2" >> $GITHUB_ENV
3838
3939
- name: Checkout
4040
uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2
4141

4242
- name: Cypress run
43-
uses: cypress-io/github-action@v2
43+
uses: cypress-io/github-action@v4
4444
with:
4545
browser: ${{ matrix.browsers }}
4646
build: npm run build

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
# production
2121
/build
22+
/dist
2223

2324
# misc
2425
.DS_Store

Diff for: .husky/pre-commit

100755100644
File mode changed.

Diff for: cypress-install.js

+13-10
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
const util = require('cypress/lib/util');
2-
const execa = require('execa');
1+
import { spawn } from 'child_process';
32

4-
const pkg = util.pkgVersion();
3+
const child = spawn('npm', ['run', 'cypress:install'], {
4+
stdio: 'inherit'
5+
});
56

6-
(async () => {
7-
console.log('Installing Cypress ' + pkg);
8-
await execa('npm', ['run', 'cypress:install'], {
9-
env: { CYPRESS_INSTALL_BINARY: pkg }
10-
});
11-
console.log('Cypress installed');
12-
})();
7+
child.on('close', code => {
8+
if (code) {
9+
console.error('Cypress installation failed with code:', code);
10+
}
11+
});
12+
13+
child.on('error', error => {
14+
console.error('Cypress installation error:', error);
15+
});

Diff for: cypress.config.ts

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
const { defineConfig } = require('cypress');
2+
3+
module.exports = defineConfig({
4+
e2e: {
5+
baseUrl: 'http://localhost:3001',
6+
retries: 4
7+
}
8+
})

Diff for: cypress.json

-3
This file was deleted.
File renamed without changes.
File renamed without changes.

Diff for: cypress/plugins/index.js

-22
This file was deleted.
File renamed without changes.
File renamed without changes.

Diff for: cypress/tsconfig.json

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es6",
4+
"module": "esnext",
5+
"allowSyntheticDefaultImports": true,
6+
"sourceMap": true,
7+
"jsx": "preserve",
8+
"allowJs": false,
9+
"noImplicitAny": true,
10+
"moduleResolution": "node",
11+
"isolatedModules": true,
12+
"types": ["node","cypress"]
13+
},
14+
"include": [
15+
"**/*.ts",
16+
],
17+
}

Diff for: public/index.html renamed to index.html

+4-3
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,8 @@
9999
</script>
100100
</head>
101101
<body>
102-
<div id="root"></div>
103-
</body>
104-
<script src="https://cdn.jsdelivr.net/npm/@widgetbot/crate@3" async defer>
102+
<div id="app"></div>
103+
<script src="https://cdn.jsdelivr.net/npm/@widgetbot/crate@3" async defer>
105104
new Crate({
106105
server: '692816967895220344', // freeCodeCamp.org Official ᕕ(⌐■_■)ᕗ ♪♬
107106
channel: '1254842489362317322' // #code-radio
@@ -116,4 +115,6 @@
116115
embed.style.maxHeight = "calc(100% - 80px)"
117116
}
118117
</script>
118+
<script type="module" src="/src/index.tsx"></script>
119+
</body>
119120
</html>

0 commit comments

Comments
 (0)