Skip to content

Commit

Permalink
Give up, use babel
Browse files Browse the repository at this point in the history
  • Loading branch information
akprasad committed Aug 24, 2022
1 parent ffa89d7 commit 14c62ee
Show file tree
Hide file tree
Showing 6 changed files with 6,722 additions and 4,597 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ js-test:
npx jest

js-coverage:
npx jest --coverage --collectCoverageFrom="./ambuda/src/js/**"
npx jest --coverage

# Lint our JavaScript code.
# FIXME(arun): typescript lint
Expand Down
7 changes: 7 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// FIXME(???): switch to esbuild for consistency with prod
module.exports = {
presets: [
['@babel/preset-env', {targets: {node: 'current'}}],
"@babel/preset-typescript",
],
};
21 changes: 13 additions & 8 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,25 @@
*/

module.exports = {
collectCoverageFrom: [
"ambuda/static/js/*.{js,ts}",
],
// Indicates whether the coverage information should be collected while executing the test
coverageDirectory: "js-coverage-report",
// Use '@' to refer to the root folder that contains all source modules.
coverageThreshold: {
global: {
statements: 20,
branches: 20,
functions: 20,
lines: 20,
}
},
// Use '@' to refer to the root folder that contains all source modules.
moduleNameMapper: {
"^@/(.*)": "<rootDir>/ambuda/static/js/$1",
},
roots: [
"<rootDir>/test/js/",
"<rootDir>/test/js/",
],
testEnvironment: "jsdom",
// Build all test code with esbuild, for consistency with prod.
transform: {
"\\.[jt]s$": [
"<rootDir>/test/TransformerEsbuild.js",
],
},
};
Loading

0 comments on commit 14c62ee

Please sign in to comment.