3.0 source code
This commit is contained in:
39
OfficeWeb/vendor/requirejs/tests/mapConfig/mapConfigSpecificity-tests.js
vendored
Normal file
39
OfficeWeb/vendor/requirejs/tests/mapConfig/mapConfigSpecificity-tests.js
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
define('foo-1.0/bar/baz', [], function(){ return '1.0'; });
|
||||
define('foo-1.2/bar/baz', [], function(){ return '1.2'; });
|
||||
|
||||
define('oldmodule', ['foo/bar/baz'], function(baz) {
|
||||
return {
|
||||
name: 'oldmodule',
|
||||
baz: baz
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
require({
|
||||
baseUrl: './',
|
||||
|
||||
map: {
|
||||
'oldmodule': {
|
||||
//This one should be favored over the * value.
|
||||
'foo' : 'foo-1.0'
|
||||
},
|
||||
|
||||
'*': {
|
||||
'foo/bar' : 'foo-1.2/bar'
|
||||
}
|
||||
}
|
||||
},
|
||||
['oldmodule'],
|
||||
function(oldmodule) {
|
||||
doh.register(
|
||||
'mapConfigSpecificity',
|
||||
[
|
||||
function mapConfigSpecificity(t){
|
||||
t.is('oldmodule', oldmodule.name);
|
||||
t.is('1.0', oldmodule.baz);
|
||||
}
|
||||
]
|
||||
);
|
||||
doh.run();
|
||||
}
|
||||
);
|
||||
Reference in New Issue
Block a user