Skip to content

Commit

Permalink
Merge pull request #1333 from ml5js/fix-jest-breaking-changes
Browse files Browse the repository at this point in the history
fix: fixes breaking changes from jest integration
  • Loading branch information
joeyklee authored Apr 6, 2022
2 parents 44b710c + c1e25ba commit 451d560
Show file tree
Hide file tree
Showing 10 changed files with 11,200 additions and 12,446 deletions.
14 changes: 0 additions & 14 deletions .babelrc

This file was deleted.

2 changes: 0 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ module.exports = {
env: {
browser: true,
jasmine: true,
"jest/globals": true,
},
plugins: ["jest"],
overrides: [
{
files: ["examples/**"],
Expand Down
184 changes: 0 additions & 184 deletions jest.config.js

This file was deleted.

85 changes: 85 additions & 0 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
const path = require("path");

module.exports = config => {
config.set({
client: {
model: config.model,
jasmine: {
random: false,
},
},
frameworks: ["jasmine"],
files: [
"src/index.js",
"src/utils/*_test.js",
`src/${config.model ? config.model : "**"}/*_test.js`,
`src/${config.model ? config.model : "**"}/**/*_test.js`,
],
preprocessors: {
"src/index.js": ["webpack"],
"src/utils/*.js": ["webpack"],
},
webpack: {
// TODO: This is duplication of the webpack.common.babel.js file, but they
// use different import syntaxes so it's not easy to just require it here.
// Maybe this could be put into a JSON file, but the include in the module
// rules is dynamic.
entry: ["babel-polyfill", "./src/index.js"],
output: {
libraryTarget: "umd",
filename: "ml5.js",
library: "ml5",
},
module: {
rules: [
{
enforce: "pre",
test: /\.js$/,
exclude: /node_modules/,
loader: "eslint-loader",
},
{
test: /\.js$/,
loader: "babel-loader",
include: path.resolve(__dirname, "src"),
},
],
},
// Don't minify the webpack build for better stack traces
optimization: {
minimize: false,
},
node: {
fs: "empty",
},
},
webpackMiddleware: {
noInfo: true,
stats: "errors-only",
},
browserStack: {
username: process.env.BROWSERSTACK_USERNAME,
accessKey: process.env.BROWSERSTACK_ACCESS_KEY,
},
captureTimeout: 500000,
reportSlowerThan: 500,
browserNoActivityTimeout: 500000,
customLaunchers: {
bs_chrome_mac: {
base: "BrowserStack",
browser: "chrome",
browser_version: "latest",
os: "OS X",
os_version: "Mojave",
},
},
reporters: ["mocha"],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ["Chrome"],
singleRun: false,
concurrency: Infinity,
});
};
Loading

0 comments on commit 451d560

Please sign in to comment.