INSTALLATION

yarn add prisma -D

npx prisma

npx prisma init -> first time prisma setup, creates prisma folder with schema.prisma inside it.

npx prisma migrate dev --name init -> new migration files create, runs the migration in database. this command also runs prisma generate under the hood. if prisma-client-js generator is defined it will check if you have or not, if not it will install.

More about tests

In agile i.e iterative (sprint wise) development, TDD(Test Driven Development) plays important role.

    Pros of TDD

  • Easy detection bugs
  • Code Quality increased.

BDD(Behavior Driven Development)

BDD based upon TDD, It is more natural than TDD in terms of language and interfaces. For example :- expect(response.status).toBe(200) => BDD. whereas TDD follows assert.equal(response.status, 200)

    3 steps of writing test code
  • Implement a test.
  • Write a code to pass that test.
  • Verify the test passes and repeat the cycle.
  • Various types of testing frameworks, for node usually mocha, for browser and react testing, jest