@samitouri / QOS-React-2 / commits / 0827646695
Fork 0

The library for web and native user interfaces.

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.

Ben Newman committed Jul 16, 2013 at 13:49 UTC 08276466952bdde2a9966f097e435a87a4867016
5 files changed +16 -30
Gruntfile.js
+1 -1
@@ -58,7 +58,7 @@ module.exports = function(grunt) {
58 grunt.registerTask('build:test', [
59 'jsx:jasmine',
60 'jsx:test',
61 - 'browserify:jasmine',
61 + 'populist:jasmine',
62 'populist:test'
63 ]);
64
grunt/config/browserify.js
-25
@@ -76,33 +76,8 @@ var transformer = {
76 after: [simpleBannerify]
77 };
78
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 -
79 module.exports = {
80 basic: basic,
104 - jasmine: jasmine,
105 - test: test,
81 min: min,
82 transformer: transformer
83 };
grunt/config/populist.js
+11
@@ -1,6 +1,16 @@
1 'use strict';
2
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 +
12 var test = {
13 + rootDirectory: "build/modules",
14 args: ["test/all:"],
15 requires: [
16 "**/__tests__/*-test.js"
@@ -9,5 +19,6 @@ var test = {
19 };
20
21 module.exports = {
22 + jasmine: jasmine,
23 test: test
24 };
grunt/tasks/populist.js
+3 -3
@@ -10,16 +10,16 @@ module.exports = function() {
10 var args = config.args;
11
12 // Make sure the things that need to be exposed are.
13 - var requires = config.requires || {};
13 + var requires = config.requires || [];
14 grunt.file.expand({
15 nonull: true, // Keep IDs that don't expand to anything.
16 - cwd: "src"
16 + cwd: config.rootDirectory
17 }, requires).forEach(function(name) {
18 args.push(name.replace(/\.js$/i, ""));
19 });
20
21 require("populist").buildP({
22 - rootDirectory: "build/modules",
22 + rootDirectory: config.rootDirectory,
23 args: args
24 }).then(function(output) {
25 grunt.file.write(config.outfile, output);
test/index.html
+1 -1
@@ -13,7 +13,7 @@
13 <script src="jasmine.js"></script>
14 <script>
15 window.onload = function() {
16 - require("jasmine").getEnv().execute();
16 + jasmine.getEnv().execute();
17 };
18 </script>
19 </head>