Giter VIP home page Giter VIP logo

aha-exam's Introduction

The Aha Exam

Tech Stack

Run dev server

npm run dev
# or
yarn dev

You can start editing the page by modifying pages/index.tsx. The page auto-updates as you edit the file.

Open https://localhost:3000/ or followig the QR-code with your browser to see the result.

Run the dv server with turbo support

# prepare
yarn global add turbo
# or
npm install turbo --global

Run the PROD server

npm run build
# or
yarn build

# then 

npm run start
# or
yarn start

Open http://localhost:3000/ or followig the QR-code with your browser to see the result.

Commit and Push

We use husky and lint-staged for executing the pre-commit and pre-push works. The pre-commit will do the lint things and make some auto-fix automatically. WE can modify the .husky/pre-commit to change the actions of pre-commit. Modifing the .lintstagedrc can change the action of lint-staged which controls the lint cli for staged files. We can add husky hook by this guideline:

// adding pre-push for example
npx husky add .husky/pre-push "npm test"
git add .husky/pre-push

Lint

For the campatibility of Linaria, we use the set of "next", "prettier", and "plugin:react-hooks/recommended" as the basement.

  • next: the limit rule set of lint
  • prettier: better support for vs-code formattor
  • react-hooks/recommended: check the hook dependencies

If we want to modify the rule individually, just change the rules section in .eslintrc.json. Please take reference to eslint rules.

Testing

Unit Testing

We use jest + React Testing Library for UI / unit test tools. Just write testings in tests directory.

// basic unit testing
describe('inintial case for test', () => {
  it('jest should be run', () => {
    expect(1 + 1).toEqual(2)
  })
})

//basic UI testing
describe('Home', () => {
  it('snapshot testing', () => {
    const { container } = render(<Home />)
    expect(container).toMatchSnapshot()
  })
})

E2E Testing

We use playwright for E2E testing. The setting files is

  • .github/ci-e2e.yml (for branch push / pull_request)
  • .github/e2e-deployment.yml (for github deployment signal)

The testing steps:

  • develop PR
    • unit / lint / build testing
    • E2E testing
  • --> main PR
    • unit / lint / build testing
    • -> deployment signal
      • E2E testing
  • --> main PUSH
  • --> Production

aha-exam's People

Contributors

ottoh avatar jim-ensage avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.