Skip to content

Commit

Permalink
feat: use vite testing
Browse files Browse the repository at this point in the history
  • Loading branch information
a2937 committed Oct 29, 2024
1 parent 67be98e commit bacd2a1
Show file tree
Hide file tree
Showing 42 changed files with 7,474 additions and 17,938 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ jobs:
run: |
echo "CYPRESS_RECORD_KEY=${{ secrets.CYPRESS_RECORD_KEY }}" >> $GITHUB_ENV
echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
echo "CYPRESS_INSTALL_BINARY=6.0.0" >> $GITHUB_ENV
echo "CYPRESS_INSTALL_BINARY=13.14.2" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2

- name: Cypress run
uses: cypress-io/github-action@v2
uses: cypress-io/github-action@v4
with:
browser: ${{ matrix.browsers }}
build: npm run build
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

# production
/build
/dist

# misc
.DS_Store
Expand Down
Empty file modified .husky/pre-commit
100755 → 100644
Empty file.
23 changes: 13 additions & 10 deletions cypress-install.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
const util = require('cypress/lib/util');
const execa = require('execa');
import { spawn } from 'child_process';

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

(async () => {
console.log('Installing Cypress ' + pkg);
await execa('npm', ['run', 'cypress:install'], {
env: { CYPRESS_INSTALL_BINARY: pkg }
});
console.log('Cypress installed');
})();
child.on('close', code => {
if (code) {
console.error('Cypress installation failed with code:', code);
}
});

child.on('error', error => {
console.error('Cypress installation error:', error);
});
8 changes: 8 additions & 0 deletions cypress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const { defineConfig } = require('cypress');

module.exports = defineConfig({
e2e: {
baseUrl: 'http://localhost:3001',
retries: 4
}
})
3 changes: 0 additions & 3 deletions cypress.json

This file was deleted.

File renamed without changes.
File renamed without changes.
22 changes: 0 additions & 22 deletions cypress/plugins/index.js

This file was deleted.

File renamed without changes.
File renamed without changes.
17 changes: 17 additions & 0 deletions cypress/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"compilerOptions": {
"target": "es6",
"module": "esnext",
"allowSyntheticDefaultImports": true,
"sourceMap": true,
"jsx": "preserve",
"allowJs": false,
"noImplicitAny": true,
"moduleResolution": "node",
"isolatedModules": true,
"types": ["node","cypress"]
},
"include": [
"**/*.ts",
],
}
7 changes: 4 additions & 3 deletions public/index.html → index.html
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,8 @@
</script>
</head>
<body>
<div id="root"></div>
</body>
<script src="https://cdn.jsdelivr.net/npm/@widgetbot/crate@3" async defer>
<div id="app"></div>
<script src="https://cdn.jsdelivr.net/npm/@widgetbot/crate@3" async defer>
new Crate({
server: '692816967895220344', // freeCodeCamp.org Official ᕕ(⌐■_■)ᕗ ♪♬
channel: '1254842489362317322' // #code-radio
Expand All @@ -116,4 +115,6 @@
embed.style.maxHeight = "calc(100% - 80px)"
}
</script>
<script type="module" src="/src/index.tsx"></script>
</body>
</html>
Loading

0 comments on commit bacd2a1

Please sign in to comment.