From 6992d5c60fe0549cb966be395f78cd2a4aa7df0e Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Fri, 8 Jan 2021 15:48:22 +0300 Subject: [PATCH] move CI testing configuration to bottom --- docs/en/UI/Angular/Testing.md | 50 ++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/docs/en/UI/Angular/Testing.md b/docs/en/UI/Angular/Testing.md index e26e1b4a51..7b93d48585 100644 --- a/docs/en/UI/Angular/Testing.md +++ b/docs/en/UI/Angular/Testing.md @@ -6,30 +6,6 @@ ABP Angular UI is tested like any other Angular application. So, [the guide here In Angular, unit tests use [Karma](https://karma-runner.github.io/) and [Jasmine](https://jasmine.github.io) by default. Although we like Jest more, we chose not to deviate from these defaults, so **the application template you download will have Karma and Jasmine preconfigured**. You can find the Karma configuration inside the _karma.conf.js_ file in the root folder. You don't have to do anything. Adding a spec file and running `npm test` will work. -You would need a different configuration for your CI environment. To set up a new configuration for your unit tests, find the test project in _angular.json_ file and add one as seen below: - -```json -// angular.json - -"test": { - "builder": "@angular-devkit/build-angular:karma", - "options": { /* several options here */ }, - "configurations": { - "production": { - "karmaConfig": "karma.conf.prod.js" - } - } -} -``` - -Now you can copy the _karma.conf.js_ as _karma.conf.prod.js_ and use any configuration you like in it. Please check [Karma configuration file document](http://karma-runner.github.io/5.2/config/configuration-file.html) for config options. - -Finally, don't forget to run your CI tests with the following command: - -```sh -npm test -- --prod -``` - ## Basics An over-simplified spec file looks like this: @@ -372,3 +348,29 @@ describe("Country", () => { }); }); ``` + +## CI Configuration + +You would need a different configuration for your CI environment. To set up a new configuration for your unit tests, find the test project in _angular.json_ file and add one as seen below: + +```json +// angular.json + +"test": { + "builder": "@angular-devkit/build-angular:karma", + "options": { /* several options here */ }, + "configurations": { + "production": { + "karmaConfig": "karma.conf.prod.js" + } + } +} +``` + +Now you can copy the _karma.conf.js_ as _karma.conf.prod.js_ and use any configuration you like in it. Please check [Karma configuration file document](http://karma-runner.github.io/5.2/config/configuration-file.html) for config options. + +Finally, don't forget to run your CI tests with the following command: + +```sh +npm test -- --prod +```