kiegroup / mock-github

A library to create a local github environment and easily mock github APIs using an octokit like interface
Apache License 2.0
59 stars 5 forks source link

differenciate between integration and unitary tests #43

Closed Ginxo closed 1 year ago

Ginxo commented 1 year ago

the idea is to be able to run unitary or integration tests since we are mixing them and it takes too long to check whether all tests are passing or not.

this guide can be followed https://medium.com/coding-stones/separating-unit-and-integration-tests-in-jest-f6dd301f399c and I would use .test.ts and .it.ts suffixes to differentiate them

This is a integration test case https://github.com/kiegroup/mock-github/blob/main/test/act/act.test.ts where act is not mocked This is a unitary test case https://github.com/kiegroup/mock-github/blob/main/test/github/github.test.ts since third-party or additional libraries are mocked

shubhbapna commented 1 year ago

By mocking act you mean mock the spawn call where we actually call the act cli tool?

Ginxo commented 1 year ago

By mocking act you mean mock the spawn call where we actually call the act cli tool?

my mistake for act case, mockapi.test is a right example @shubhbapna

shubhbapna commented 1 year ago

So for Act and ActionCompiler we really can't change anything right? For MockGithub we have already implemented this. So this will just impact Moctokit and Mockapi correct?

shubhbapna commented 1 year ago

Not relevant as of now since Act, Mockapi and ActionCompiler were removed