Skip to content

Commit

Permalink
Rewrite UI and add Jest tests everywhere (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
robmosca committed Oct 10, 2023
1 parent c78c3cc commit 488d475
Show file tree
Hide file tree
Showing 44 changed files with 5,949 additions and 1,331 deletions.
20 changes: 15 additions & 5 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
{
"presets": [
"@babel/preset-env",
],
"presets": ["@babel/preset-env"],
"plugins": [
["@babel/plugin-transform-react-jsx", { "pragma": "h" }],
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-class-properties"
],
}
"env": {
"test": {
"presets": [
[
"@babel/preset-env",
{
"targets": { "node": "current" }
}
]
]
}
}
}
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "origin/main",
"baseBranch": "origin/travelperk",
"updateInternalDependencies": "patch",
"ignore": []
}
5 changes: 5 additions & 0 deletions .changeset/quiet-houses-poke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"import-map-overrides": major
---

Rewrite UI and add Jest tests
7 changes: 3 additions & 4 deletions jest.config.cjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
/** @type {import('jest').Config} */
const config = {
module.exports = {
collectCoverageFrom: ["src/**/*.js", "!src/api/local-storage-mock.js"],
preset: "jest-preset-preact",
resetMocks: true,
restoreMocks: true,
setupFiles: ["./jest.setup.js"],
testEnvironment: "jsdom",
collectCoverageFrom: ["src/**/*.js", "!src/api/localStorageMock.js"],
};

module.exports = config;
4 changes: 3 additions & 1 deletion jest.setup.js
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
require("jest-fetch-mock").enableMocks();
import jestFetchMock from "jest-fetch-mock";

jestFetchMock.enableMocks();
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"clean": "rimraf dist",
"watch": "cross-env NODE_ENV=development rollup -c --watch",
"copy-test-files": "copyfiles test/**/* dist -f",
"serve": "serve .",
"serve": "serve . -l 5050",
"embed-serve": "serve . -l 3333",
"test": "jest",
"lint": "eslint src",
Expand Down Expand Up @@ -46,6 +46,9 @@
"@changesets/cli": "^2.26.2",
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-node-resolve": "^13.0.2",
"@testing-library/jest-dom": "^6.0.0",
"@testing-library/preact": "^3.2.3",
"babel-jest": "^29.6.2",
"concurrently": "^6.2.0",
"copyfiles": "^2.4.1",
"cross-env": "^7.0.3",
Expand All @@ -57,6 +60,7 @@
"jest-cli": "^29.5.0",
"jest-environment-jsdom": "^29.5.0",
"jest-fetch-mock": "^3.0.3",
"jest-preset-preact": "^4.1.0",
"postcss": "^8.3.5",
"preact": "^10.5.14",
"prettier": "^2.3.2",
Expand All @@ -69,7 +73,7 @@
"serve": "^14.2.0"
},
"dependencies": {
"cookie": "^0.4.1"
"cookie": "^0.5.0"
},
"packageManager": "[email protected]"
}
Loading

0 comments on commit 488d475

Please sign in to comment.