This repository has been archived by the owner on Oct 9, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d7bfb5f
commit a8d3500
Showing
2 changed files
with
27 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
var Builder = require('../index'); | ||
var builder = new Builder(); | ||
|
||
builder.loadConfigSync('./test/fixtures/test-tree.config.js'); | ||
|
||
builder.config({ transpiler: 'babel' }); | ||
|
||
var baseURL = builder.loader.baseURL; | ||
|
||
suite('Canonical Names', function() { | ||
test('Simple canonical', function() { | ||
assert.equal(builder.getCanonicalName('amd.js'), 'amd.js'); | ||
}); | ||
|
||
test('Wildcard', function() { | ||
assert.equal(builder.getCanonicalName(baseURL + 'test/fixtures/test-tree/asdf'), 'asdf'); | ||
}); | ||
|
||
test('Exact beats wildcard', function() { | ||
assert.equal(builder.getCanonicalName(baseURL + 'node_modules/babel-core/browser.js'), 'babel'); | ||
}); | ||
|
||
test('Wildcard extensions', function() { | ||
assert.equal(builder.getCanonicalName(baseURL + 'test/dummy/file.jade'), 'file.jade'); | ||
}); | ||
}); |
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