Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Test components #1137

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ node_modules
.DS_Store
.vscode
.node_modules_git
*.swp
tags
tags.*
6 changes: 6 additions & 0 deletions .jest.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"setupFiles": ["./jestSetup.js"],
"transform": {
"^.+\\.js$": "./jestProcess"
}
}
10 changes: 10 additions & 0 deletions jestProcess.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const babelOptions = {
presets: ["env", "stage-0", "react"],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stage-0 seems like it's a bit much to me, do you know what JS feature exactly this is adding that the tests need?

I did try running without stage-0 and it didn't work.

plugins: [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are these for? I ran your tests locally without any plugins and it still worked.

I suggest removing this if they are not needed.

"transform-class-properties",
"transform-async-to-generator",
"transform-es2015-classes",
],
};

module.exports = require("babel-jest").createTransformer(babelOptions);
5 changes: 5 additions & 0 deletions jestSetup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// setup file
import { configure } from "enzyme";
import Adapter from "enzyme-adapter-react-16";

configure({ adapter: new Adapter() });
Loading