Skip to content

Commit 0827646

Browse files
committed
Use populist for building jasmine test harness package.
We're using populist for building the bundle of test modules and their dependencies, so it seems worthwhile for consistency to do the same for the test harness.
1 parent 03578e6 commit 0827646

File tree

5 files changed

+16
-30
lines changed

5 files changed

+16
-30
lines changed

Gruntfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ module.exports = function(grunt) {
5858
grunt.registerTask('build:test', [
5959
'jsx:jasmine',
6060
'jsx:test',
61-
'browserify:jasmine',
61+
'populist:jasmine',
6262
'populist:test'
6363
]);
6464

grunt/config/browserify.js

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -76,33 +76,8 @@ var transformer = {
7676
after: [simpleBannerify]
7777
};
7878

79-
var jasmine = {
80-
entries: [
81-
"./build/jasmine/all.js"
82-
],
83-
requires: {
84-
"jasmine": "./build/jasmine/all.js"
85-
},
86-
outfile: "./build/jasmine.js",
87-
debug: false
88-
};
89-
90-
var test = {
91-
entries: [
92-
"./build/modules/test/all.js",
93-
],
94-
requires: [
95-
"**/__tests__/*-test.js"
96-
],
97-
outfile: './build/react-test.js',
98-
debug: false,
99-
standalone: false
100-
};
101-
10279
module.exports = {
10380
basic: basic,
104-
jasmine: jasmine,
105-
test: test,
10681
min: min,
10782
transformer: transformer
10883
};

grunt/config/populist.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
'use strict';
22

3+
var jasmine = {
4+
rootDirectory: "build/jasmine",
5+
// This syntax means to require and expose the "jasmine" module
6+
// (build/jasmine/jasmine.js) as global.jasmine, and to require the
7+
// "all" module (build/jasmine/all.js) but not expose it globally.
8+
args: ["jasmine:jasmine", "all:"],
9+
outfile: "./build/jasmine.js"
10+
};
11+
312
var test = {
13+
rootDirectory: "build/modules",
414
args: ["test/all:"],
515
requires: [
616
"**/__tests__/*-test.js"
@@ -9,5 +19,6 @@ var test = {
919
};
1020

1121
module.exports = {
22+
jasmine: jasmine,
1223
test: test
1324
};

grunt/tasks/populist.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ module.exports = function() {
1010
var args = config.args;
1111

1212
// Make sure the things that need to be exposed are.
13-
var requires = config.requires || {};
13+
var requires = config.requires || [];
1414
grunt.file.expand({
1515
nonull: true, // Keep IDs that don't expand to anything.
16-
cwd: "src"
16+
cwd: config.rootDirectory
1717
}, requires).forEach(function(name) {
1818
args.push(name.replace(/\.js$/i, ""));
1919
});
2020

2121
require("populist").buildP({
22-
rootDirectory: "build/modules",
22+
rootDirectory: config.rootDirectory,
2323
args: args
2424
}).then(function(output) {
2525
grunt.file.write(config.outfile, output);

test/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<script src="jasmine.js"></script>
1414
<script>
1515
window.onload = function() {
16-
require("jasmine").getEnv().execute();
16+
jasmine.getEnv().execute();
1717
};
1818
</script>
1919
</head>

0 commit comments

Comments
 (0)