Skip to content

Commit 81dffdc

Browse files
committedApr 21, 2024
Initialize Jest Testing Framework.
1 parent f7eebf8 commit 81dffdc

File tree

4 files changed

+6314
-1878
lines changed

4 files changed

+6314
-1878
lines changed
 

‎README.md

+85-18
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,88 @@
1-
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
1+
<h1 align="center"">Map of Pi</h1>
2+
3+
<div align="center">
4+
5+
[![Hackathon](https://img.shields.io/badge/hackathon-PiCommerce-purple.svg)](https://github.com/pi-apps/PiOS/blob/main/pi-commerce.md)
6+
![Status](https://img.shields.io/badge/status-active-success.svg)
7+
[![Netlify Status](https://api.netlify.com/api/v1/badges/1d8fa9c7-015b-4531-9b81-ccf16517b39b/deploy-status)](https://app.netlify.com/sites/map-of-pi/deploys)
8+
![License](https://img.shields.io/badge/license-PIOS-blue.svg)
9+
10+
</div>
11+
12+
<div>
13+
<p align="justify"><b>Map of Pi</b> is a mobile application developed to help Pi community members easily locate local businesses that accept Pi as payment. This project was initiated as part of the Pi Commerce Hackathon with the goal of facilitating Pi transactions and connecting businesses with the Pi community.</p>
14+
</div>
15+
16+
## Table of Contents
17+
18+
- [Brand Design](#brand-design)
19+
- [Tech Stack](#tech-stack)
20+
- [Frontend Local Execution](#frontend-local-execution)
21+
- [Team](#team)
22+
- [Contributions](#contributions)
23+
24+
## <a name='brand-design'></a>Brand Design
25+
26+
| App Logo | App Icon |
27+
| ------------- |:-------------:|
28+
| <img src="https://i.ibb.co/GTRWzSb/map-of-pi-logo-revised-3.png" alt="map-of-pi-logo-revised-3" border="0"> | <img src="https://i.ibb.co/4FQqXTG/map-of-pi-app-icon-revised-3b-transparent.png" alt="map-of-pi-app-icon-revised-3b-transparent" border="0">
29+
30+
## <a name='tech-stack'></a>Tech Stack 📊
31+
32+
- **Frontend**: React, TypeScript, HTML, SCSS, CSS
33+
- **Backend**: Node.js, REST API
34+
- **Database**: MongoDB
35+
- **DevOps**: GitHub Actions, Netlify
36+
37+
## <a name='frontend-local-execution'></a>Frontend Local Execution
38+
39+
The Map of Pi Front End is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) which is a React framework to build web applications.
40+
41+
### Build the Project
42+
43+
- Run `npm run build` to build the project; builds the app for production to the `build` folder.
44+
- The build artifacts are bundled for production mode and optimized for the best performance.
45+
46+
### Execute the Development Server
47+
48+
- Execute `npm run dev` to spin up a dev server.
49+
- Navigate to http://localhost:3000/ in your browser.
50+
- The application will automatically reload if you change any of the source files.
51+
- Lint errors will be displayed in the console.
52+
53+
### Execute Unit Tests
54+
55+
- Run `npm run test` to launch the [Jest](https://jestjs.io/) Testing Framework in the interactive watch mode.
56+
57+
## <a name='team'></a>Team 🧑👩‍🦱🧔👨🏾‍🦱👨🏾
58+
59+
### Project Manager
60+
- Philip Jennings
61+
62+
### Marketing
63+
- Bonnie Ford
64+
- Joseph Ciccone
65+
66+
### Solution Design / UX
67+
- Femma Ashraf
68+
- Oluwabukola Adesina
69+
- Folorunsho Omotunde
70+
71+
### DevOps
72+
- Danny Lee
73+
74+
### Frontend Developers
75+
- Darin Hajou
76+
- Zoltan Magyar
77+
78+
### Backend Developers
79+
- Rokundo Soleil
80+
81+
## <a name='contributions'></a>Contributions
82+
83+
<div>
84+
<p align="justify">We welcome contributions from the community to improve the Map of Pi project.</p>
85+
</div>
286

387
## Getting Started
488

@@ -17,20 +101,3 @@ bun dev
17101
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
18102

19103
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
20-
21-
This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
22-
23-
## Learn More
24-
25-
To learn more about Next.js, take a look at the following resources:
26-
27-
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
28-
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
29-
30-
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
31-
32-
## Deploy on Vercel
33-
34-
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
35-
36-
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.

‎jest.config.ts

+199
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
1+
/**
2+
* For a detailed explanation regarding each configuration property, visit:
3+
* https://jestjs.io/docs/configuration
4+
*/
5+
6+
import type {Config} from 'jest';
7+
8+
const config: Config = {
9+
// All imported modules in your tests should be mocked automatically
10+
// automock: false,
11+
12+
// Stop running tests after `n` failures
13+
// bail: 0,
14+
15+
// The directory where Jest should store its cached dependency information
16+
// cacheDirectory: "C:\\Users\\swoos\\AppData\\Local\\Temp\\jest",
17+
18+
// Automatically clear mock calls, instances, contexts and results before every test
19+
clearMocks: true,
20+
21+
// Indicates whether the coverage information should be collected while executing the test
22+
collectCoverage: true,
23+
24+
// An array of glob patterns indicating a set of files for which coverage information should be collected
25+
// collectCoverageFrom: undefined,
26+
27+
// The directory where Jest should output its coverage files
28+
coverageDirectory: "coverage",
29+
30+
// An array of regexp pattern strings used to skip coverage collection
31+
// coveragePathIgnorePatterns: [
32+
// "\\\\node_modules\\\\"
33+
// ],
34+
35+
// Indicates which provider should be used to instrument code for coverage
36+
// coverageProvider: "babel",
37+
38+
// A list of reporter names that Jest uses when writing coverage reports
39+
// coverageReporters: [
40+
// "json",
41+
// "text",
42+
// "lcov",
43+
// "clover"
44+
// ],
45+
46+
// An object that configures minimum threshold enforcement for coverage results
47+
// coverageThreshold: undefined,
48+
49+
// A path to a custom dependency extractor
50+
// dependencyExtractor: undefined,
51+
52+
// Make calling deprecated APIs throw helpful error messages
53+
// errorOnDeprecated: false,
54+
55+
// The default configuration for fake timers
56+
// fakeTimers: {
57+
// "enableGlobally": false
58+
// },
59+
60+
// Force coverage collection from ignored files using an array of glob patterns
61+
// forceCoverageMatch: [],
62+
63+
// A path to a module which exports an async function that is triggered once before all test suites
64+
// globalSetup: undefined,
65+
66+
// A path to a module which exports an async function that is triggered once after all test suites
67+
// globalTeardown: undefined,
68+
69+
// A set of global variables that need to be available in all test environments
70+
// globals: {},
71+
72+
// The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers.
73+
// maxWorkers: "50%",
74+
75+
// An array of directory names to be searched recursively up from the requiring module's location
76+
// moduleDirectories: [
77+
// "node_modules"
78+
// ],
79+
80+
// An array of file extensions your modules use
81+
// moduleFileExtensions: [
82+
// "js",
83+
// "mjs",
84+
// "cjs",
85+
// "jsx",
86+
// "ts",
87+
// "tsx",
88+
// "json",
89+
// "node"
90+
// ],
91+
92+
// A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
93+
// moduleNameMapper: {},
94+
95+
// An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
96+
// modulePathIgnorePatterns: [],
97+
98+
// Activates notifications for test results
99+
// notify: false,
100+
101+
// An enum that specifies notification mode. Requires { notify: true }
102+
// notifyMode: "failure-change",
103+
104+
// A preset that is used as a base for Jest's configuration
105+
preset: 'ts-jest',
106+
107+
// Run tests from one or more projects
108+
// projects: undefined,
109+
110+
// Use this configuration option to add custom reporters to Jest
111+
// reporters: undefined,
112+
113+
// Automatically reset mock state before every test
114+
// resetMocks: false,
115+
116+
// Reset the module registry before running each individual test
117+
// resetModules: false,
118+
119+
// A path to a custom resolver
120+
// resolver: undefined,
121+
122+
// Automatically restore mock state and implementation before every test
123+
// restoreMocks: false,
124+
125+
// The root directory that Jest should scan for tests and modules within
126+
// rootDir: undefined,
127+
128+
// A list of paths to directories that Jest should use to search for files in
129+
// roots: [
130+
// "<rootDir>"
131+
// ],
132+
133+
// Allows you to use a custom runner instead of Jest's default test runner
134+
// runner: "jest-runner",
135+
136+
// The paths to modules that run some code to configure or set up the testing environment before each test
137+
// setupFiles: [],
138+
139+
// A list of paths to modules that run some code to configure or set up the testing framework before each test
140+
// setupFilesAfterEnv: [],
141+
142+
// The number of seconds after which a test is considered as slow and reported as such in the results.
143+
// slowTestThreshold: 5,
144+
145+
// A list of paths to snapshot serializer modules Jest should use for snapshot testing
146+
// snapshotSerializers: [],
147+
148+
// The test environment that will be used for testing
149+
testEnvironment: "jsdom",
150+
151+
// Options that will be passed to the testEnvironment
152+
// testEnvironmentOptions: {},
153+
154+
// Adds a location field to test results
155+
// testLocationInResults: false,
156+
157+
// The glob patterns Jest uses to detect test files
158+
// testMatch: [
159+
// "**/__tests__/**/*.[jt]s?(x)",
160+
// "**/?(*.)+(spec|test).[tj]s?(x)"
161+
// ],
162+
163+
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
164+
// testPathIgnorePatterns: [
165+
// "\\\\node_modules\\\\"
166+
// ],
167+
168+
// The regexp pattern or array of patterns that Jest uses to detect test files
169+
// testRegex: [],
170+
171+
// This option allows the use of a custom results processor
172+
// testResultsProcessor: undefined,
173+
174+
// This option allows use of a custom test runner
175+
// testRunner: "jest-circus/runner",
176+
177+
// A map from regular expressions to paths to transformers
178+
// transform: undefined,
179+
180+
// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
181+
// transformIgnorePatterns: [
182+
// "\\\\node_modules\\\\",
183+
// "\\.pnp\\.[^\\\\]+$"
184+
// ],
185+
186+
// An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them
187+
// unmockedModulePathPatterns: undefined,
188+
189+
// Indicates whether each individual test should be reported during the run
190+
verbose: true,
191+
192+
// An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode
193+
// watchPathIgnorePatterns: [],
194+
195+
// Whether to use watchman for file crawling
196+
// watchman: true,
197+
};
198+
199+
export default config;

‎package-lock.json

+6,015-1,853
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+15-7
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,34 @@
11
{
22
"name": "map-of-pi-frontend-react",
3-
"version": "0.1.0",
3+
"version": "2.0.0",
4+
"author": "Map of Pi Team",
5+
"description": "Map of Pi Frontend React",
6+
"license": "PiOS",
47
"private": true,
58
"scripts": {
69
"dev": "next dev",
710
"build": "next build",
811
"start": "next start",
9-
"lint": "next lint"
12+
"lint": "next lint",
13+
"test": "jest"
1014
},
1115
"dependencies": {
16+
"next": "14.2.2",
1217
"react": "^18",
13-
"react-dom": "^18",
14-
"next": "14.2.2"
18+
"react-dom": "^18"
1519
},
1620
"devDependencies": {
17-
"typescript": "^5",
21+
"@testing-library/jest-dom": "^6.4.2",
22+
"@testing-library/react": "^15.0.2",
1823
"@types/node": "^20",
1924
"@types/react": "^18",
2025
"@types/react-dom": "^18",
26+
"eslint": "^8",
27+
"eslint-config-next": "14.2.2",
28+
"jest": "^29.7.0",
29+
"jest-environment-jsdom": "^29.7.0",
2130
"postcss": "^8",
2231
"tailwindcss": "^3.4.1",
23-
"eslint": "^8",
24-
"eslint-config-next": "14.2.2"
32+
"typescript": "^5"
2533
}
2634
}

0 commit comments

Comments
 (0)
Please sign in to comment.