feat(core): provide support for relative assets for components
Assets defined for `templateUrl` and `styleUrls` can now be loaded in relative to where the component file is placed so long as the `moduleId` is set within the component annotation. Closes #5634 Closes #5634
This commit is contained in:
@@ -65,5 +65,59 @@ export function main() {
|
||||
});
|
||||
});
|
||||
|
||||
describe('stripLeft', () => {
|
||||
it('should strip the first character of the string if it matches the provided input', () => {
|
||||
var input = "~angular2 is amazing";
|
||||
var expectedOutput = "angular2 is amazing";
|
||||
|
||||
expect(StringWrapper.stripLeft(input, "~")).toEqual(expectedOutput);
|
||||
});
|
||||
|
||||
it('should keep stripping characters from the start until the first unmatched character',
|
||||
() => {
|
||||
var input = "#####hello";
|
||||
var expectedOutput = "hello";
|
||||
expect(StringWrapper.stripLeft(input, "#")).toEqual(expectedOutput);
|
||||
});
|
||||
|
||||
it('should not alter the provided input if the first charater does not match the provided input',
|
||||
() => {
|
||||
var input = "+angular2 is amazing";
|
||||
expect(StringWrapper.stripLeft(input, "*")).toEqual(input);
|
||||
});
|
||||
|
||||
it('should not do any alterations when an empty string or null value is passed in', () => {
|
||||
expect(StringWrapper.stripLeft("", "S")).toEqual("");
|
||||
expect(StringWrapper.stripLeft(null, "S")).toEqual(null);
|
||||
});
|
||||
});
|
||||
|
||||
describe('stripRight', () => {
|
||||
it('should strip the first character of the string if it matches the provided input', () => {
|
||||
var input = "angular2 is amazing!";
|
||||
var expectedOutput = "angular2 is amazing";
|
||||
|
||||
expect(StringWrapper.stripRight(input, "!")).toEqual(expectedOutput);
|
||||
});
|
||||
|
||||
it('should not alter the provided input if the first charater does not match the provided input',
|
||||
() => {
|
||||
var input = "angular2 is amazing+";
|
||||
|
||||
expect(StringWrapper.stripRight(input, "*")).toEqual(input);
|
||||
});
|
||||
|
||||
it('should keep stripping characters from the end until the first unmatched character',
|
||||
() => {
|
||||
var input = "hi&!&&&&&";
|
||||
var expectedOutput = "hi&!";
|
||||
expect(StringWrapper.stripRight(input, "&")).toEqual(expectedOutput);
|
||||
});
|
||||
|
||||
it('should not do any alterations when an empty string or null value is passed in', () => {
|
||||
expect(StringWrapper.stripRight("", "S")).toEqual("");
|
||||
expect(StringWrapper.stripRight(null, "S")).toEqual(null);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user