Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed issues with various kinds of custom builds, added testsuite
- Loading branch information
1 parent
8c1c16e
commit 8f45315
Showing
16 changed files
with
374 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
/node_modules/ | ||
/fixtures/ | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
/*global require: true */ | ||
|
||
/* | ||
* grunt-backbonebuilder | ||
* https://github.com/asciidisco/grunt-backbonebuilder | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,57 @@ | ||
'use strict'; | ||
|
||
var grunt = require('grunt'); | ||
// Load local tasks. | ||
grunt.loadTasks('tasks'); | ||
|
||
exports['require'] = { | ||
setUp: function(done) { | ||
'use strict'; | ||
// setup here | ||
done(); | ||
} | ||
}, | ||
// test if building from a custom minified file fails | ||
'testIfBuildingFromMinifiedFails': function(test) { | ||
'use strict'; | ||
var builder = require(__dirname + '/../lib/builder').init(grunt); | ||
test.expect(2); | ||
|
||
// tests here | ||
builder.build({ | ||
config: {include: ['View'], src: __dirname + '/../node_modules/backbone/backbone-min.js'} | ||
}, function (transport) { | ||
test.equal(transport.type, 'error', 'Error has been detected'); | ||
test.equal(transport.content.search('unminified'), 26, 'Correct error message has been send'); | ||
test.done(); | ||
}); | ||
}, | ||
// test if building from a custom input file works | ||
'testIfBuildingFromCustomInputWorks': function(test) { | ||
'use strict'; | ||
var builder = require(__dirname + '/../lib/builder').init(grunt); | ||
test.expect(2); | ||
|
||
// tests here | ||
builder.build({ | ||
config: {include: ['All'], src: __dirname + '/../node_modules/backbone/backbone.js'} | ||
}, function (transport) { | ||
test.equal(transport.type, 'content', 'Transport type set correctly'); | ||
test.equal(transport.content.length, 53107, 'File could be build'); | ||
test.done(); | ||
}); | ||
}, | ||
// test if building from a custom input file works | ||
'testIfBuildingFromNonExistingFileFails': function(test) { | ||
'use strict'; | ||
var builder = require(__dirname + '/../lib/builder').init(grunt); | ||
test.expect(2); | ||
|
||
// tests here | ||
builder.build({ | ||
config: {include: ['All'], src: __dirname + 'xxx.js'} | ||
}, function (transport) { | ||
test.equal(transport.type, 'error', 'Transport type set correctly'); | ||
test.equal(transport.content.search('Could not load given'), 0, 'Correct error message has been send'); | ||
test.done(); | ||
}); | ||
}, | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<!DOCTYPE HTML> | ||
<html> | ||
<head> | ||
<title>Backbone Test Suite</title> | ||
<link rel="stylesheet" href="../../node_modules/backbone/test/vendor/qunit.css" type="text/css" media="screen" /> | ||
<script src="../../node_modules/backbone/test/vendor/json2.js"></script> | ||
<script src="../../node_modules/backbone/test/vendor/jquery-1.7.1.js"></script> | ||
<script src="../../node_modules/backbone/test/vendor/qunit.js"></script> | ||
<script type="text/javascript"> | ||
QUnit.config.reorder = false; | ||
</script> | ||
<script src="../../node_modules/backbone/test/vendor/jslitmus.js"></script> | ||
<script src="../../node_modules/backbone/test/vendor/underscore-1.3.1.js"></script> | ||
<script src="../../fixtures/backbone.custom.Collection.js"></script> | ||
<script src="../../node_modules/backbone/test/collection.js"></script> | ||
</head> | ||
<body> | ||
<h1 id="qunit-header">Backbone Test Suite</h1> | ||
<div id="qunit-testrunner-toolbar"></div> | ||
<h2 id="qunit-banner"></h2> | ||
<h2 id="qunit-userAgent"></h2> | ||
<ol id="qunit-tests"></ol> | ||
<br /><br /> | ||
<h1 id="qunit-header"><a href="#">Backbone Speed Suite</a></h1> | ||
<div id="jslitmus_container" style="margin: 20px 10px;"></div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<!DOCTYPE HTML> | ||
<html> | ||
<head> | ||
<title>Backbone Test Suite</title> | ||
<link rel="stylesheet" href="../../node_modules/backbone/test/vendor/qunit.css" type="text/css" media="screen" /> | ||
<script src="../../node_modules/backbone/test/vendor/json2.js"></script> | ||
<script src="../../node_modules/backbone/test/vendor/jquery-1.7.1.js"></script> | ||
<script src="../../node_modules/backbone/test/vendor/qunit.js"></script> | ||
<script type="text/javascript"> | ||
QUnit.config.reorder = false; | ||
</script> | ||
<script src="../../node_modules/backbone/test/vendor/underscore-1.3.1.js"></script> | ||
<script src="../../node_modules/backbone/backbone.js"></script> | ||
|
||
<script src="../../fixtures/backbone.custom.Events.js"></script> | ||
</head> | ||
<body> | ||
<h1 id="qunit-header">Backbone Test Suite</h1> | ||
<div id="qunit-testrunner-toolbar"></div> | ||
<h2 id="qunit-banner"></h2> | ||
<h2 id="qunit-userAgent"></h2> | ||
<ol id="qunit-tests"></ol> | ||
</body> | ||
</html> |
Oops, something went wrong.