Skip to content

Commit 9dc6a3d

Browse files
committed
Merge pull request react-bootstrap#865 from AlexKVal/tools
Fix testing with tools/release
2 parents 2873801 + 09d2195 commit 9dc6a3d

File tree

4 files changed

+22
-6
lines changed

4 files changed

+22
-6
lines changed

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@
99
"homepage": "http://react-bootstrap.github.io/",
1010
"scripts": {
1111
"build": "babel-node tools/build-cli.js",
12-
"test-watch": "karma start",
13-
"test-coverage": "npm run build && COVERAGE=true karma start --single-run",
14-
"test": "npm run lint && npm run build && karma start --single-run && _mocha --compilers js:babel-core/register test/server/*Spec.js",
12+
"lib-build": "babel-node tools/build-cli.js --lib-only",
13+
"test-watch": "npm run lib-build && karma start",
14+
"test-coverage": "npm run lib-build && COVERAGE=true karma start --single-run",
15+
"test": "npm run lint && npm run build && npm run tests-set",
16+
"tests-set": "karma start --single-run && _mocha --compilers js:babel-core/register test/server/*Spec.js",
1517
"lint": "eslint ./",
1618
"docs-build": "babel-node tools/build-cli.js --docs-only",
1719
"docs": "babel-node docs/dev-run",

tools/build-cli.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import 'colors';
44
import build from './build';
55
import docs from '../docs/build';
6+
import lib from './lib/build';
67
import { setExecOptions } from './exec';
78

89
import yargs from 'yargs';
@@ -12,6 +13,11 @@ const argv = yargs
1213
demand: false,
1314
default: false
1415
})
16+
.option('lib-only', {
17+
demand: false,
18+
default: false,
19+
describe: 'Used for factories testing'
20+
})
1521
.option('verbose', {
1622
demand: false,
1723
default: false,
@@ -26,7 +32,15 @@ const argv = yargs
2632

2733
setExecOptions(argv);
2834

29-
let buildProcess = argv.docsOnly ? docs(argv) : build();
35+
let buildProcess;
36+
37+
if (argv.libOnly) {
38+
buildProcess = lib();
39+
} else if (argv.docsOnly) {
40+
buildProcess = docs(argv);
41+
} else {
42+
buildProcess = build();
43+
}
3044

3145
buildProcess
3246
.catch(err => {

tools/release-scripts/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { exec } from '../exec';
44
function test() {
55
console.log('Running: '.cyan + 'tests'.green);
66

7-
return exec('karma start --single-run')
7+
return exec('npm run lib-build && npm run tests-set')
88
.then(() => console.log('Completed: '.cyan + 'tests'.green));
99
}
1010

tools/release-scripts/version-bump.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export default function({ preid, type }) {
3535
console.log('Version changed from '.cyan + oldVersion.green + ' to '.cyan + version.green);
3636
json.version = version;
3737

38-
return fsp.writeFile(packagePath, JSON.stringify(json, null, 2))
38+
return fsp.writeFile(packagePath, JSON.stringify(json, null, 2) + '\n')
3939
.then(() => safeExec(`git add ${packagePath}`))
4040
.then(() => json.version);
4141
});

0 commit comments

Comments
 (0)