Skip to content

Commit

Permalink
Fix jest issues
Browse files Browse the repository at this point in the history
  • Loading branch information
aelassas committed Apr 27, 2024
1 parent 13994ae commit 649913b
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 26 deletions.
25 changes: 0 additions & 25 deletions api/.babelrc.json

This file was deleted.

36 changes: 36 additions & 0 deletions api/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
const babel = (api) => {
const isTest = api.env('test')

const plugins = [
[
'module-resolver',
{
alias: {
':bookcars-types': '../packages/bookcars-types',
},
},
],
]

if (!isTest) {
plugins.push('add-import-extension')
}

return {
presets: [
[
'@babel/preset-env',
{
modules: false,
targets: {
node: 'current',
},
},
],
'@babel/preset-typescript',
],
plugins,
}
}

export default babel
2 changes: 1 addition & 1 deletion api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"dev": "nodemon",
"build": "rimraf dist && tsc --build --verbose&& babel dist -d dist",
"start": "npm run build && node dist/src",
"test": "rimraf coverage && tsc --build --verbose && cross-env NODE_ENV=test NODE_OPTIONS=--experimental-vm-modules jest --coverage",
"test": "rimraf coverage && tsc --build --verbose && cross-env NODE_OPTIONS=--experimental-vm-modules jest --coverage",
"lint": "eslint --ext .ts .",
"ncu": "ncu -u -x eslint"
},
Expand Down

0 comments on commit 649913b

Please sign in to comment.