Babel
This commit is contained in:
parent
00c30d4449
commit
c9305e51e1
16
.github/actions/test.yml
vendored
Normal file
16
.github/actions/test.yml
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
name: frontendTesting
|
||||
run-name:¡Testing frontend
|
||||
on: [push]
|
||||
jobs:
|
||||
run-defined-frontend-tests:
|
||||
runs-on: ubuntu-latest
|
||||
defaults:
|
||||
run:
|
||||
working-directory: ./
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '14'
|
||||
- run: npm ci
|
||||
- run: npm test:unit
|
16
babel.config.js
Normal file
16
babel.config.js
Normal file
@ -0,0 +1,16 @@
|
||||
module.exports = {
|
||||
env: {
|
||||
test: {
|
||||
presets: [
|
||||
[
|
||||
"@babel/preset-env",
|
||||
{
|
||||
targets: {
|
||||
node: "current",
|
||||
},
|
||||
},
|
||||
],
|
||||
],
|
||||
},
|
||||
},
|
||||
}
|
20
jest.config.js
Normal file
20
jest.config.js
Normal file
@ -0,0 +1,20 @@
|
||||
|
||||
module.exports = {
|
||||
testEnvironment: "jsdom",
|
||||
transform: {
|
||||
"^.+\\.vue$": "@vue/vue3-jest",
|
||||
"^.+\\js$": "babel-jest",
|
||||
},
|
||||
testRegex: "(/__tests__/.*|(\\.|/)(test|spec))\\.(js|ts)$",
|
||||
moduleFileExtensions: ["vue", "js"],
|
||||
moduleNameMapper: {
|
||||
"^@/(.*)$": "<rootDir>/src/$1",
|
||||
},
|
||||
coveragePathIgnorePatterns: ["/node_modules/", "/tests/"],
|
||||
coverageReporters: ["text", "json-summary"],
|
||||
// Fix in order for vue-test-utils to work with Jest 29
|
||||
// https://test-utils.vuejs.org/migration/#test-runners-upgrade-notes
|
||||
testEnvironmentOptions: {
|
||||
customExportConditions: ["node", "node-addons"],
|
||||
},
|
||||
}
|
8191
package-lock.json
generated
8191
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
12
package.json
12
package.json
@ -4,16 +4,24 @@
|
||||
"description": "Vtt",
|
||||
"main": "prebuild.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"test:unit": "jest",
|
||||
"generate-docs": "npx jsdoc -c jsdoc.json"
|
||||
},
|
||||
"author": "Aran Roig",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@vue/compiler-sfc": "^3.5.11",
|
||||
"motion": "^10.18.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/preset-env": "^7.25.7",
|
||||
"@vue/test-utils": "^2.4.6",
|
||||
"@vue/vue3-jest": "^29.2.6",
|
||||
"babel-jest": "^29.7.0",
|
||||
"clean-jsdoc-theme": "^4.3.0",
|
||||
"jsdoc": "^4.0.3"
|
||||
"jest": "^29.7.0",
|
||||
"jest-environment-jsdom": "^29.7.0",
|
||||
"jsdoc": "^4.0.3",
|
||||
"vue-jest": "^3.0.7"
|
||||
}
|
||||
}
|
||||
|
5
tests/test.spec.js
Normal file
5
tests/test.spec.js
Normal file
@ -0,0 +1,5 @@
|
||||
describe("HelloWorld", () => {
|
||||
it("renders properly", () => {
|
||||
expect("Hello Jest").toContain("Hello Jest")
|
||||
})
|
||||
})
|
Loading…
Reference in New Issue
Block a user