-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* upgrade webpack * fix jest tests * fix cypress tests * solve issue with storybook config * upgrade react to 17 * update yarn lock * fix circleci cypress * fix circleci cypress for real Co-authored-by: Essential Randomness <essential.randomn3ss@gmail.com>
- Loading branch information
1 parent
b80b05f
commit 6f85b84
Showing
16 changed files
with
3,789 additions
and
4,579 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,32 @@ | ||
const webpackConfig = require("../webpack.config.cjs"); | ||
|
||
const MiniCssExtractPlugin = require("mini-css-extract-plugin"); | ||
|
||
module.exports = { | ||
stories: ["../stories/**/*.stories.tsx"], | ||
addons: [ | ||
"@storybook/addon-links", | ||
"@storybook/addon-controls", | ||
"@storybook/addon-viewport/register", | ||
"@storybook/addon-actions", | ||
"@storybook/addon-a11y", | ||
"storybook-css-modules-preset", | ||
], | ||
webpackFinal: async (config) => { | ||
addons: ["@storybook/addon-links", "@storybook/addon-controls", "@storybook/addon-viewport/register", "@storybook/addon-actions", "@storybook/addon-a11y", "storybook-css-modules-preset"], | ||
webpackFinal: async config => { | ||
config.devtool = "inline-source-map"; | ||
config.module.rules.push({ | ||
test: /\.(ts|tsx)$/, | ||
use: [ | ||
{ | ||
loader: require.resolve("babel-loader"), | ||
options: { | ||
presets: ["@babel/preset-env", "@babel/preset-react"], | ||
}, | ||
}, | ||
], | ||
use: [{ | ||
loader: require.resolve("babel-loader"), | ||
options: { | ||
presets: ["@babel/preset-env", "@babel/preset-react"] | ||
} | ||
}] | ||
}); | ||
|
||
config.module.rules.push({ | ||
test: /\.html$/, | ||
use: ["html-loader"], | ||
use: ["html-loader"] | ||
}); | ||
|
||
config.resolve.extensions.push(".ts", ".tsx"); | ||
return config; | ||
}, | ||
features: { | ||
postcss: false, | ||
postcss: false | ||
}, | ||
}; | ||
core: { | ||
builder: "webpack5" | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { defineConfig } from "cypress"; | ||
|
||
export default defineConfig({ | ||
component: { | ||
specPattern: "tests/**/*.spec.{js,ts,jsx,tsx}", | ||
video: false, | ||
screenshotOnRunFailure: false, | ||
chromeWebSecurity: false, | ||
supportFile: "./tests/utils/cypress/commands.js", | ||
devServer: { | ||
framework: "react", | ||
bundler: "webpack", | ||
// optionally pass in webpack config | ||
webpackConfig: require("./tests/utils/cypress/webpack.config.js"), | ||
}, | ||
indexHtmlFile: "./tests/utils/cypress/cypress-root.html", | ||
}, | ||
}); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<title>Cypress tests</title> | ||
</head> | ||
<body> | ||
<div data-cy-root></div> | ||
</body> | ||
</html> |
2 changes: 1 addition & 1 deletion
2
cypress/plugins/webpack.config.js → tests/utils/cypress/webpack.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
const path = require("path"); | ||
module.exports = { | ||
process(_, filename) { | ||
return "module.exports = " + JSON.stringify(path.basename(filename)) + ";"; | ||
return { | ||
code: "module.exports = " + JSON.stringify(path.basename(filename)) + ";", | ||
}; | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = { | ||
process(source) { | ||
return { | ||
code: `module.exports = ${JSON.stringify(source)};`, | ||
}; | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.