Skip to content

Commit

Permalink
fix(test): get test webpack to compile again
Browse files Browse the repository at this point in the history
  • Loading branch information
STRML committed Aug 27, 2019
1 parent b8e0405 commit 30b2569
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 32 deletions.
9 changes: 9 additions & 0 deletions index-babel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
var Draggable = require('./lib/Draggable').default;

// Previous versions of this lib exported <Draggable> as the root export. As to not break
// them, or TypeScript, we export *both* as the root and as 'default'.
// See https://github.com/mzabriskie/react-draggable/pull/254
// and https://github.com/mzabriskie/react-draggable/issues/266
module.exports = Draggable;
module.exports.default = Draggable;
module.exports.DraggableCore = require('./lib/DraggableCore').default;
34 changes: 9 additions & 25 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,17 @@ module.exports = function(config) {
},

webpack: {
mode: 'production',
module: {
// Suppress power-assert warning
exprContextCritical: false,
loaders: [
rules: [
{
test: /\.(?:jsx?)$/,
loader: 'babel-loader',
query: {
cacheDirectory: true,
},
exclude: /node_modules/
},
{
test: /\.json$/,
loader: 'json-loader'
test: /\.(?:js|es).?$/,
loader: 'babel-loader?cacheDirectory',
exclude: /(node_modules)/
}
],
]
},
plugins: [
new webpack.DefinePlugin({
Expand All @@ -46,9 +40,9 @@ module.exports = function(config) {
}
})
],
resolve: {
extensions: ['.js']
}
performance: {
hints: false
}
},

webpackServer: {
Expand Down Expand Up @@ -80,15 +74,5 @@ module.exports = function(config) {
},

singleRun: true,

plugins: [
'karma-jasmine',
'karma-phantomjs-launcher',
'karma-firefox-launcher',
'karma-chrome-launcher',
'karma-ie-launcher',
'karma-webpack',
'karma-phantomjs-shim',
]
});
};
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
"eslint-plugin-react": "^7.5.1",
"flow-bin": "^0.69.0",
"jasmine-core": "^3.4.0",
"json-loader": "^0.5.7",
"karma": "^4.2.0",
"karma-chrome-launcher": "^3.1.0",
"karma-cli": "2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion specs/draggable.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from 'react';
import ReactDOM from 'react-dom';
import TestUtils from 'react-dom/test-utils';
import ShallowRenderer from 'react-test-renderer/shallow';
import Draggable, {DraggableCore} from '../index';
import Draggable, {DraggableCore} from '../index-babel';
import FrameComponent from 'react-frame-component';
import assert from 'power-assert';
import _ from 'lodash';
Expand Down
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3860,11 +3860,6 @@ jsesc@~0.5.0:
resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d"
integrity sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=

json-loader@^0.5.7:
version "0.5.7"
resolved "https://registry.yarnpkg.com/json-loader/-/json-loader-0.5.7.tgz#dca14a70235ff82f0ac9a3abeb60d337a365185d"
integrity sha512-QLPs8Dj7lnf3e3QYS1zkCo+4ZwqOiF9d/nZnYozTISxXWCfNs9yuky5rJw4/W34s7POaNlbZmQGaB5NiXCbP4w==

json-parse-better-errors@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9"
Expand Down

0 comments on commit 30b2569

Please sign in to comment.