Skip to content

Commit b3cf414

Browse files
committed
#9, misc test framework enhancements.
1 parent 9e274e1 commit b3cf414

File tree

5 files changed

+207
-72
lines changed

5 files changed

+207
-72
lines changed

karma.conf.js

+11-10
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
const webpackCfg = require('./webpack.config')
2-
const ChromiumRevision = require('puppeteer/package.json').puppeteer
3-
.chromium_revision
4-
const Downloader = require('puppeteer/utils/ChromiumDownloader')
5-
const revisionInfo = Downloader.revisionInfo(
6-
Downloader.currentPlatform(),
7-
ChromiumRevision
8-
)
9-
10-
process.env.CHROME_BIN = revisionInfo.executablePath
1+
if (process.argv.indexOf('--browsers') < 0) {
2+
const ChromiumRevision = require('puppeteer/package.json').puppeteer
3+
.chromium_revision
4+
const Downloader = require('puppeteer/utils/ChromiumDownloader')
5+
const revisionInfo = Downloader.revisionInfo(
6+
Downloader.currentPlatform(),
7+
ChromiumRevision
8+
)
9+
process.env.CHROME_BIN = revisionInfo.executablePath
10+
}
1111

12+
const webpackCfg = require('./webpack.config')
1213
module.exports = function(config) {
1314
config.set({
1415
basePath: '',

package-lock.json

+135-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"copy-webpack-plugin": "^3.0.1",
4242
"cross-env": "^5.0.5",
4343
"css-loader": "^0.23.0",
44+
"enzyme": "^2.9.1",
4445
"eslint": "^4.7.2",
4546
"eslint-loader": "^1.9.0",
4647
"eslint-plugin-react": "^7.3.0",

showprepper.sublime-project

+59-60
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,65 @@
11
{
2-
"build_systems": [
3-
{
4-
"cmd": [
5-
"node.exe",
6-
"server.js"
7-
],
8-
"env":
2+
"build_systems": [{
3+
"cmd": [
4+
"node.exe",
5+
"server.js"
6+
],
7+
"env": {
8+
"env": "dev",
9+
"port": "8888"
10+
},
11+
"name": "node-app",
12+
"working_dir": "${project_path}"
13+
},
14+
{
15+
"cmd": [
16+
"npm.cmd",
17+
"test"
18+
],
19+
"name": "npm-run-test",
20+
"working_dir": "${project_path}",
21+
"target": "ansi_color_build",
22+
"syntax": "Packages/ANSIescape/ANSI.tmLanguage"
23+
},
24+
{
25+
"cmd": [
26+
"npm.cmd",
27+
"run",
28+
"dist"
29+
],
30+
"name": "npm-run-dist",
31+
"working_dir": "${project_path}",
32+
"target": "ansi_color_build",
33+
"syntax": "Packages/ANSIescape/ANSI.tmLanguage"
34+
},
35+
{
36+
"cmd": [
37+
"node.exe",
38+
"node_modules/karma/bin/karma",
39+
"start",
40+
"--no-single-run",
41+
"--no-colors",
42+
"--browsers",
43+
"Chrome"
44+
],
45+
"env": {
46+
"NODE_ENV": "test"
47+
},
48+
"name": "debug-karma",
49+
"working_dir": "${project_path}"
50+
}
51+
],
52+
"folders": [{
53+
"path": "."
54+
},
955
{
10-
"env": "dev",
11-
"port": "8888"
56+
"path": "../impress.js"
1257
},
13-
"name": "node-app",
14-
"working_dir": "${project_path}"
15-
},
16-
{
17-
"cmd": [
18-
"npm.cmd",
19-
"test"
20-
],
21-
"name": "npm-run-test",
22-
"working_dir": "${project_path}",
23-
"target": "ansi_color_build",
24-
"syntax": "Packages/ANSIescape/ANSI.tmLanguage"
25-
},
26-
{
27-
"cmd": [
28-
"npm.cmd",
29-
"run",
30-
"dist"
31-
],
32-
"name": "npm-run-dist",
33-
"working_dir": "${project_path}",
34-
"target": "ansi_color_build",
35-
"syntax": "Packages/ANSIescape/ANSI.tmLanguage"
36-
},
37-
{
38-
"cmd": [
39-
"node.exe",
40-
"--inspect-brk",
41-
"node_modules/karma/bin/karma",
42-
"start"
43-
],
44-
"env":
4558
{
46-
"NODE_ENV": "test"
59+
"path": "../strut2"
4760
},
48-
"name": "debug-karma",
49-
"working_dir": "${project_path}",
50-
"target": "ansi_color_build",
51-
"syntax": "Packages/ANSIescape/ANSI.tmLanguage"
52-
}],
53-
"folders": [
54-
{
55-
"path": "."
56-
},
57-
{
58-
"path": "../impress.js"
59-
},
60-
{
61-
"path": "../strut2"
62-
},
63-
{
64-
"path": "../Strut"
65-
}]
61+
{
62+
"path": "../Strut"
63+
}
64+
]
6665
}

test/components/AppTest.js

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ describe('MainComponent', () => {
1818
})
1919

2020
it('should have its component name as default className', () => {
21+
debugger
2122
expect(MainComponent.props.className).to.equal('sp-main-container')
2223
})
2324
})

0 commit comments

Comments
 (0)