From 7be802155d7a64c306c10802391bff1b5bafc46b Mon Sep 17 00:00:00 2001 From: yogevbd Date: Sat, 14 Sep 2019 23:08:49 +0300 Subject: [PATCH] Fix js tests --- lib/src/commands/Commands.test.ts | 7 +++++++ package.json | 7 +++++-- scripts/test-js.js | 4 +--- scripts/test.js | 2 +- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/lib/src/commands/Commands.test.ts b/lib/src/commands/Commands.test.ts index 698ebf7..dd1a299 100644 --- a/lib/src/commands/Commands.test.ts +++ b/lib/src/commands/Commands.test.ts @@ -185,4 +185,11 @@ describe('Commands', () => { verify(mockedNativeCommandsSender.getDeliveredNotifications()).called(); }); }); + + describe('refreshToken', () => { + it('sends to native', () => { + uut.refreshToken(); + verify(mockedNativeCommandsSender.refreshToken()).called(); + }); + }); }); diff --git a/package.json b/package.json index dca1dad..2085625 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "scripts": { "build": "rm -rf ./lib/dist && tsc", "prestart": "npm run build", - "pretest": "./node_modules/.bin/eslint *.js test", + "pretest-js": "npm run build", "test": "node scripts/test", "start": "node ./scripts/start", "pretest-e2e-ios-release": "npm run build", @@ -108,13 +108,16 @@ }, "roots": [ "/node_modules/", - "/test/" + "/lib/dist/" ], "collectCoverageFrom": [ + "lib/dist/**/*.js", "lib/src/**/*.js", "integration/**/*.js", "!lib/dist/index.js", "!lib/dist/Notifications.js", + "!lib/dist/NotificationsIOS.js", + "!lib/dist/NotificationsAndroid.js", "!lib/dist/adapters/**/*", "!lib/dist/interfaces/**/*", "!lib/dist/**/*.test.*", diff --git a/scripts/test-js.js b/scripts/test-js.js index 953a9e5..0613aa3 100644 --- a/scripts/test-js.js +++ b/scripts/test-js.js @@ -5,10 +5,8 @@ const fix = _.includes(process.argv, '--fix') ? '--fix' : ''; const dirs = [ 'lib', - 'integration', - 'e2e', 'scripts', - 'playground/src' + 'example/src' ]; run(); diff --git a/scripts/test.js b/scripts/test.js index 2f4ad9f..31f9bb6 100644 --- a/scripts/test.js +++ b/scripts/test.js @@ -3,7 +3,7 @@ const exec = require('shell-utils').exec; run(); function run() { - exec.execSync(`jest`); + exec.execSync(`npm run test-js`); exec.execSync(`npm run test-unit-ios`); exec.execSync(`npm run test-unit-android`); } -- 2.26.2