Skip to content

Commit

Permalink
jest (#216)
Browse files Browse the repository at this point in the history
* Add jest test framework

* Remove console.logs

* Remove outdated preset that depended on vulnerable packages
  • Loading branch information
Duddino authored Oct 13, 2023
1 parent 0481fb9 commit 65dc91c
Show file tree
Hide file tree
Showing 6 changed files with 13,784 additions and 3,781 deletions.
4 changes: 4 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"presets": ["@babel/preset-env"],
"plugins": ["babel-plugin-transform-import-meta"]
}
2 changes: 2 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,5 @@ jobs:
with:
eslint: true
prettier: true
- name: Run tests
run: npm test
24 changes: 24 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* For a detailed explanation regarding each configuration property, visit:
* https://jestjs.io/docs/configuration
*/

/** @type {import('jest').Config} */
const config = {
// An array of file extensions your modules use
moduleFileExtensions: ['js', 'json', 'vue'],

// A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
moduleNameMapper: {
'^lodash-es$': 'lodash',
},

// The test environment that will be used for testing
testEnvironment: 'node',
transform: {
'.*\\.(vue)$': '@vue/vue3-jest',
'.*\\.(js)$': 'babel-jest',
},
};

export default config;
Loading

0 comments on commit 65dc91c

Please sign in to comment.