[pluginsFunctionality | DONE | ADDED] add a test file app.component.spec.ts checking about piwik, run tests on build
This commit is contained in:
parent
e0242ddace
commit
3e3a98e522
|
@ -197,7 +197,7 @@
|
||||||
"tsConfig": "src/tsconfig.spec.json",
|
"tsConfig": "src/tsconfig.spec.json",
|
||||||
"karmaConfig": "src/karma.conf.js",
|
"karmaConfig": "src/karma.conf.js",
|
||||||
"styles": [
|
"styles": [
|
||||||
"src/styles.css"
|
"src/styles.less"
|
||||||
],
|
],
|
||||||
"scripts": [],
|
"scripts": [],
|
||||||
"assets": [
|
"assets": [
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
"ng": "ng",
|
"ng": "ng",
|
||||||
"start": "ng serve --disable-host-check --host 0.0.0.0 --port 4200",
|
"start": "ng serve --disable-host-check --host 0.0.0.0 --port 4200",
|
||||||
"build": "ng build",
|
"build": "ng build",
|
||||||
"build-dev": "ng build --configuration=development",
|
"build-dev": "ng build --configuration=development && ng test --watch=false",
|
||||||
"build-beta": "ng build --configuration=beta",
|
"build-beta": "ng build --configuration=beta && ng test --watch=false",
|
||||||
"build-prod": "ng build --configuration production",
|
"build-prod": "ng build --configuration production && ng test --watch=false",
|
||||||
"webpack-bundle-analyzer": "ng build --stats-json && webpack-bundle-analyzer dist/connect/browser/stats.json --host 0.0.0.0",
|
"webpack-bundle-analyzer": "ng build --stats-json && webpack-bundle-analyzer dist/connect/browser/stats.json --host 0.0.0.0",
|
||||||
"test": "ng test",
|
"test": "ng test",
|
||||||
"e2e": "ng e2e",
|
"e2e": "ng e2e",
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
import {TestBed } from '@angular/core/testing';
|
||||||
|
import {properties} from "../environments/environment";
|
||||||
|
|
||||||
|
describe('Environment Configuration', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should have correct setting for piwik tracking based on environment', () => {
|
||||||
|
if (properties.environment == "beta" || properties.environment == "production") {
|
||||||
|
expect(properties.enablePiwikTrack).toBe(true,`Piwik tracking: Expected enablePiwikTrack to be true but it is ${properties.enablePiwikTrack}`);
|
||||||
|
} else {
|
||||||
|
expect(properties.enablePiwikTrack).toBe(false, `Piwik tracking: Expected enablePiwikTrack to be false but it is ${properties.enablePiwikTrack}`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Add more tests for other properties as needed
|
||||||
|
});
|
Loading…
Reference in New Issue