Skip to content

Commit d913c1a

Browse files
committed
#9 avoid double mount for impress show
1 parent 7c7cafb commit d913c1a

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

karma.conf.js

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ module.exports = function(config) {
2020
basePath: '',
2121
browsers: ['ChromeHeadless'],
2222
files: ['test/loadTests.js'],
23-
port: 8080,
2423
captureTimeout: 60000,
2524
frameworks: ['mocha', 'chai'],
2625
client: {

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"serve:dist": "node server.js --env=dist",
1818
"start": "node server.js --env=dev",
1919
"test": "cross-env NODE_ENV=test karma start",
20+
"test:debug": "cross-env NODE_ENV=test karma start --no-single-run --browsers Chrome",
2021
"test:watch": "cross-env NODE_ENV=test karma start --no-colors --no-single-run",
2122
"heroku-postbuild": "npm run dist"
2223
},

showprepper.sublime-project

+8-3
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,15 @@
2323
},
2424
{
2525
"cmd": [
26-
"npm.cmd",
27-
"run",
28-
"test:watch"
26+
"node",
27+
"node_modules/karma/bin/karma",
28+
"start",
29+
"--no-colors",
30+
"--no-single-run"
2931
],
32+
"env": {
33+
"NODE_ENV": "test"
34+
},
3035
"name": "npm-run-test:watch",
3136
"working_dir": "${project_path}"
3237
},

src/components/show/impress.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,9 @@ let Presentation = class extends AutoScale.autoScaleMixin(React.Component) {
148148
)
149149
}
150150
}
151+
if (require.main === module) {
152+
// Render the main component into the dom
153+
ReactDOM.render(<Presentation />, document.getElementById('app'))
154+
}
155+
// for testing
151156
export default Presentation
152-
// Render the main component into the dom
153-
ReactDOM.render(<Presentation />, document.getElementById('app'))

0 commit comments

Comments
 (0)