karma-typescript-angular2-transform v5.5.4
karma-typescript-angular2-transform
Karma-Typescript :heart: Angular
This plugin rewrites relative urls in the templateUrl and styleUrls properties of Angular components,
making sure that the Angular framework can resolve the urls when running tests with karma-typescript, eliminating the need to use module.id for resolving paths.
The absolute urls are calculated using the basePath and urlRoot properties in karma.conf.js.
Installation
$ npm install --save-dev karma-typescript-angular2-transformConfiguration
In the karma-typescript section of karma.conf.js:
karmaTypescriptConfig: {
bundlerOptions: {
transforms: [
require("karma-typescript-angular2-transform")
]
}
}Example code
import { Component } from import { Component } from "@angular/core";
@Component({
selector: "app-mock",
styleUrls: ["style.css", "./style.less", "../style.scss"],
templateUrl: "mock.html"
})
export class MockComponent {}Licensing
This software is licensed with the MIT license.
© 2016-2021 Erik Barke, Monounity
2 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
7 years ago
7 years ago
7 years ago
7 years ago
8 years ago
8 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago