Skip to content

Commit

Permalink
feat: add unit test for app store
Browse files Browse the repository at this point in the history
  • Loading branch information
nikaaru authored and yeager-eren committed Apr 9, 2024
1 parent bc36e7a commit 9df49a8
Show file tree
Hide file tree
Showing 6 changed files with 643 additions and 2 deletions.
33 changes: 33 additions & 0 deletions docs/test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Test


## How to write a test

it's essential to adhere to the following principles:

- Test descriptions should be meaningful.
- Use only English lowercase letters for descriptions.
- Test descriptions is better to start with the verb.
- Provide specific details about the functionality being tested.
- Use descriptive names for tests to facilitate understanding.
- Organize tests logically to enhance readability and navigation.
- Use edge cases and boundary conditions to ensure comprehensive testing.
- You can use `@faker-js/faker` library to create fake data



## Examples

To clarify the topic, some examples of token sort tests are given:

good example:
- put pinned tokens first
- put native tokens first
- should be first result when address contains searched term

bad example:
- pinned tokens are displayed first
- put pinned tokens
- Put Pinned tokens first
- when address contains searched term, should be first

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
"@babel/core": "^7.22.5",
"@commitlint/cli": "^18.6.1",
"@commitlint/config-conventional": "^18.6.2",
"@faker-js/faker": "^8.4.1",
"@lingui/cli": "^4.2.1",
"@nrwl/workspace": "^15.9.2",
"@types/react": "^18.0.26",
Expand Down
7 changes: 5 additions & 2 deletions widget/embedded/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
"ts-check": "tsc --declaration --emitDeclarationOnly -p ./tsconfig.json",
"clean": "rimraf dist",
"format": "prettier --write '{.,src}/**/*.{ts,tsx}'",
"lint": "eslint \"**/*.{ts,tsx}\" --ignore-path ../../.eslintignore"
"lint": "eslint \"**/*.{ts,tsx}\" --ignore-path ../../.eslintignore",
"test": "vitest",
"test:watch": "vitest --watch",
"test:coverage": "vitest run --coverage"
},
"dependencies": {
"@lingui/core": "4.2.1",
Expand Down Expand Up @@ -49,4 +52,4 @@
"publishConfig": {
"access": "public"
}
}
}
Loading

0 comments on commit 9df49a8

Please sign in to comment.