Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,11 @@
"indent": ["error", 2],
"quotes": ["error", "single"],
"semi": ["error", "always"]
},
"globals": {
"page": true,
"browser": true,
"context": true,
"jestPuppeteer": true
}
}
1 change: 0 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ name: PR Build

on:
push:
branches: ["master"]
pull_request:
branches: ["master"]

Expand Down
21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,16 @@ If you need to update `npm`, you can make it using `npm`!
cd NotificationCenter
npm install --force

Note:
Make sure that you have correct endpoint set inside `config/.env` file:
You case this URL for dev notifications: https://d2xm4bcf3at21r.cloudfront.net/dynNotifications.json
## Configuring endpoint

In order to use notification endpoints, set them under appropriate files in [config](config) folder.

- To use dev endpoint, set `NOTIFICATION_URL="https://d2xm4bcf3at21r.cloudfront.net/dynNotifications.json"` in [config/.env.dev](`config/.env.dev`)
- To use production endpoint, set `NOTIFICATION_URL="https://ddehnr4ewobxc.cloudfront.net/dynNotifications.json"` in [config/.env](config/.env)

## Running the project

npm run start
npm run start:dev

## Simple build for development

Expand All @@ -85,7 +88,15 @@ We use [ESlint](https://eslint.org/) to analyze and find problems. It has [integ

We use [jest](https://jestjs.io/) to run our tests.

- To run test.
- To run unit test

npm run test:unit

- To run e2e test

npm run test:e2e

- To run all tests

npm run test
This script also runs `npm run lint:fix` script
2 changes: 1 addition & 1 deletion config/.env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
NOTIFICATION_URL="https://ddehnr4ewobxc.cloudfront.net/dynNotifications.json"
# NOTIFICATION_URL="https://ddehnr4ewobxc.cloudfront.net/dynNotifications.json"
2 changes: 1 addition & 1 deletion config/.env.dev
Original file line number Diff line number Diff line change
@@ -1 +1 @@
NOTIFICATION_URL=""
NOTIFICATION_URL="https://d2xm4bcf3at21r.cloudfront.net/dynNotifications.json"
12 changes: 12 additions & 0 deletions jest-puppeteer.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
server: {
command: 'npm run start:dev',
port: 8080,
launchTimeout: 30000,
},
launch: {
headless: true,
timeout: 30000,
},
exitOnPageError: false
};
25 changes: 18 additions & 7 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,21 @@
*/

module.exports = {
collectCoverage: true,
collectCoverageFrom: ['src/**/*.{js,jsx}'],
coverageDirectory: '<rootDir>/reports/coverage',
moduleNameMapper: {
'\\.(jpg|jpeg|png|gif)$': '<rootDir>/tests/__mocks__/fileMock.js',
'\\.(css|less)$': '<rootDir>/tests/__mocks__/styleMock.js',
},
projects: [
{
displayName: 'Unit Tests',
testMatch: ['<rootDir>/tests/unit/*.test.js'],
moduleNameMapper: {
'\\.(jpg|jpeg|png|gif)$': '<rootDir>/tests/unit/__mocks__/fileMock.js',
'\\.(css|less)$': '<rootDir>/tests/unit/__mocks__/styleMock.js',
},
},
{
displayName: 'E2E Tests',
testMatch: ['<rootDir>/tests/e2e/*.test.js'],
preset: 'jest-puppeteer',
}
],
reporters: [
'default',
[
Expand All @@ -23,4 +31,7 @@ module.exports = {
},
],
],
collectCoverage: true,
collectCoverageFrom: ['<rootDir>/src/**/*.{js,jsx}'],
coverageDirectory: '<rootDir>/reports/coverage',
};
Loading