Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
feature: add pipeline for e2e test and unit tests, update Hello compo…
Browse files Browse the repository at this point in the history
…nent, update cypress config
  • Loading branch information
Szymon Brud committed Feb 17, 2024
1 parent 786ad0d commit cb5737b
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 71 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/E2E-cypress.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Cypress Tests E2E

on: push

jobs:
cypress-run:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cypress run
uses: cypress-io/github-action@v6
with:
build: npm run build
start: npm run start
11 changes: 11 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Unit tests
on: push
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install modules
run: npm install
- name: Run tests
run: npm run test
73 changes: 4 additions & 69 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,70 +1,5 @@
# Getting Started with Create React App
# NAVMAP

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

## Available Scripts

In the project directory, you can run:

### `npm start`

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in your browser.

The page will reload when you make changes.\
You may also see any lint errors in the console.

### `npm test`

Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `npm run build`

Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

### `npm run eject`

**Note: this is a one-way operation. Once you `eject`, you can't go back!**

If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.

You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.

## Learn More

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).

To learn React, check out the [React documentation](https://reactjs.org/).

### Code Splitting

This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)

### Analyzing the Bundle Size

This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)

### Making a Progressive Web App

This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)

### Advanced Configuration

This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)

### Deployment

This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)

### `npm run build` fails to minify

This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
### How to run a project locally
1. `npm install`
2. `npm run start`
1 change: 1 addition & 0 deletions cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const { defineConfig } = require('cypress');

module.exports = defineConfig({
e2e: {
baseUrl: 'http://localhost:3000',
setupNodeEvents() {
// implement node event listeners here
},
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/example-test.cy.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
describe('Example tests', () => {
it('Example test', () => {
cy.visit('https://localhost:3000');
cy.visit('/');
});
});
2 changes: 1 addition & 1 deletion src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from 'react';
import { Hello } from './components/Hello/Hello';

function App() {
return <Hello text={'HELLO NAVMAP'} />;
return <Hello text={'HELLO NAVMAP cypress'} />;
}

export default App;
6 changes: 6 additions & 0 deletions src/components/Hello/Hello.style.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import styled from 'styled-components';

import media from '../../assets/styles/media';

export const StyledText = styled.h1`
font-weight: 700;
text-align: center;
color: ${({ theme }) => theme.colors.black_100};
${media.desktop`
font-size: 4.5rem;
`}
`;

0 comments on commit cb5737b

Please sign in to comment.