Last active
August 29, 2015 14:01
-
-
Save Evgenus/20521870f81efb4a3448 to your computer and use it in GitHub Desktop.
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
describe 'Building module with unknown dependency', -> | |
base = -> | |
before -> | |
@old_cwd = process.cwd() | |
process.chdir("/") | |
it 'should report unresolved dependency', -> | |
builder = spa.Builder.from_config("/testimonial/spa.yaml") | |
expect(builder.build.bind(builder)) | |
.to.throw(spa.UnresolvedDependencyError) | |
.that.deep.equals(new spa.UnresolvedDependencyError("/a.js", "/b")) | |
after -> | |
mock.restore() | |
process.chdir(@old_cwd) | |
describe 'in CommonJS format', -> | |
base() | |
beforeEach -> | |
mock(yaml.safeLoad(""" | |
testimonial: | |
a.js: | | |
var b = require("/b"); | |
spa.yaml: | | |
root: "./" | |
""")) | |
describe 'in AMD format', -> | |
base() | |
beforeEach -> | |
mock(yaml.safeLoad(""" | |
testimonial: | |
a.js: | | |
define(["/b"], function(b) {}); | |
spa.yaml: | | |
manifest: manifest.json | |
root: "./" | |
""")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment