Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to README (main) #89

Merged
merged 5 commits into from
Feb 5, 2024
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
39 changes: 38 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,44 @@ The frontend of the Notes App is built with React, Vite.js, and Tailwind CSS. It
The backend of the Notes App is powered by Node.js, Express.js, Mongoose, and Docker. It provides a robust API for managing notes, handling user authentication, and interacting with a MongoDB database. The backend follows a modular architecture with routes, controllers, models, and utilities for different aspects of the application logic.

## 🧪 Testing
A key objective of this project was learning and implementing tests. The READMEs for both the frontend and backend provide detailed insights into the testing strategies and methodologies.
A key objective of this project was learning and implementing tests. The READMEs for both the frontend and backend provide detailed insights into the testing strategies and methodologies. In this project we are utilizing Jest on both the frontend and backend for testing React, and Node.js (ES6).

- **Unit Test**: Tests that cover isolated modules or "units" of code without depending on outside modules. Typically, these test individual functions or branches of code.

- **Integration Test**: Tests that cover multiple modules together interacting with each other.

- **End-to-End Tests**: Tests functionality of an entire software application from start to finish by simulating UI interactions and replicating live data.

- **Test Case**: A series of tasks/functions that set an environment to verify functionality. It may include mocking data, running functions, and assertions.

- **Test Suite**: A group of logically similar tests that together cover test cases for one job.

- **Mocking**: Simulating data or functions in a test environment to avoid using live/production data or functions.

- **Assertion**: Declares the expected behavior or outcome of a test.

Here are some methods you may encounter throughout our tests and what they do:

- `describe()`: Instantiates a test suite. The first argument is a string that describes the suite, which is also the suite's name. The second argument is a callback function that can contain another suite or test.

- `test()` or `it()`: Instantiates a test. The first argument is the test description or name, and the second argument is a callback function containing the test. Both `test()` and `it()` have the same functionality but use different naming conventions for readability. For example:
```javascript
test("Should do this thing", () => {
// Test logic here
})
it("Does this thing", () => {
// Test logic here
})
```
- `jest.fn()`: This function mimics a function. When mocking dependencies within a test, you can use jest.fn() to simulate a function call and mock return data.

- `expect()`: Instantiates an assertion. expect() takes in a value and provides access to matchers that evaluate whether the value meets specific conditions. For example:
```javascript
const name = "Notes-App";
expect(name).toBe("Notes-App")
```
For more information about Jest and its capabilities, you can refer to the [Jest documentation](https://jestjs.io/docs/getting-started).


## 🚀 Getting Started
1. Clone the repository: `git clone https://github.com/wadedesir/notes-app.git`
Expand Down
4 changes: 2 additions & 2 deletions frontend/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
env: { browser: true, es2020: true, jest: true },
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:react-hooks/recommended',
'plugin:react-hooks/recommended'
],
ignorePatterns: ['dist', '.eslintrc.cjs', 'cypress*', '*.test.js', 'coverage'],
parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
Expand Down
Loading