Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fixes breaking changes from jest integration #1333

Merged
merged 1 commit into from
Apr 6, 2022
Merged
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
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