From fe5d58285eefbe70fbd83295bd757853d4bec9f2 Mon Sep 17 00:00:00 2001 From: tonyfages Date: Tue, 2 Apr 2024 13:16:17 +0200 Subject: [PATCH] first tests --- .drone.yml | 3 ++- .gitignore | 4 +++- .../{Tests/ActionsTests => tests/redux}/ActionsTests.test.ts | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) rename JokesApp/{Tests/ActionsTests => tests/redux}/ActionsTests.test.ts (97%) diff --git a/.drone.yml b/.drone.yml index b2d97fc..9614be3 100644 --- a/.drone.yml +++ b/.drone.yml @@ -18,4 +18,5 @@ commands: - cd JokesApp - npm install - - sonar-scanner -Dsonar.projectKey=$${project_key} -Dsonar.sources=. -Dsonar.host.url=$${sonar_host} -Dsonar.login=$${sonar_token} \ No newline at end of file + - npm run test + - sonar-scanner -Dsonar.projectKey=$${project_key} -Dsonar.sources=. -Dsonar.host.url=$${sonar_host} -Dsonar.login=$${sonar_token} -Dsonar.javascript.lcov.reportPaths=/lcov.info -Dsonar.exclusions=/coverage//*,/tests/*/ \ No newline at end of file diff --git a/.gitignore b/.gitignore index afad348..03e6d7d 100644 --- a/.gitignore +++ b/.gitignore @@ -419,7 +419,8 @@ FodyWeavers.xsd .LSOverride # Icon must end with two \r -Icon +Icon + # Thumbnails ._* @@ -440,3 +441,4 @@ Network Trash Folder Temporary Items .apdisk +coverage \ No newline at end of file diff --git a/JokesApp/Tests/ActionsTests/ActionsTests.test.ts b/JokesApp/tests/redux/ActionsTests.test.ts similarity index 97% rename from JokesApp/Tests/ActionsTests/ActionsTests.test.ts rename to JokesApp/tests/redux/ActionsTests.test.ts index 6e9125e..806fc4f 100644 --- a/JokesApp/Tests/ActionsTests/ActionsTests.test.ts +++ b/JokesApp/tests/redux/ActionsTests.test.ts @@ -10,7 +10,7 @@ import { } from "../../redux/actions/customAction"; -describe('Action Tests', () => { +describe('Action tests', () => { it('setPostJoke creates correct action', () => { const postJoke = new CustomJoke('test', 'Why did the chicken...', 'To get to the other side!', 'http://www.jokes.com/joke1', "1"); const expectedAction = {