You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat : exports test cases and mocks as yaml files (#31)
* test
Signed-off-by: iamskp99 <iamskp99@gmail.com>
* feat : add test export
Signed-off-by: iamskp99 <iamskp99@gmail.com>
* feat : add feature to add custom mock export and test export path
Signed-off-by: iamskp99 <iamskp99@gmail.com>
* docs(update) : add information about test and mock export
Signed-off-by: iamskp99 <iamskp99@gmail.com>
* docs(update) : add information about test and mock export
Signed-off-by: iamskp99 <iamskp99@gmail.com>
* docs(update) : add documentation of octokit
Signed-off-by: iamskp99 <iamskp99@gmail.com>
* docs(update) : add documentation of octokit
Signed-off-by: iamskp99 <iamskp99@gmail.com>
* docs(update) : add documentation of mock library
Signed-off-by: iamskp99 <iamskp99@gmail.com>
* feat : exports testcases and mocks as yaml files
Signed-off-by: iamskp99 <iamskp99@gmail.com>
* feat(ts-sdk): added support for test coverage (#29)
* fix(express.ts): header and body issue
* fix(express.ts): header and body issue
* fix(express.ts): header and body issue
* fix(express.ts): header and body issue
* feat:changes for check method
* adding
* check method update
* check method update
* wip
* fix: call create inside middleware
* fix: adds calls for test and denoise methods
during capturing the response a subsequent denoise call is made to identify the noise fields and
test method is fixed to test the captured api responses
* refactor: removes unfinished changes
* style: fixes sethttpheaders
* fix(simulate): adds request headers in simulate api call
* fix: adds time delay before calling test function
* fix(register): adds the properties of express object into wrapped object
* fix: fixes borales/action-yarn version to 2.1.0
* fix(middleware): adds finish event callback to record the asynchronous responses from the handlers
makes a call to capture the testcases before sending the response to the client and after res.send
call by the handler.
* docs: adds documentation for integration with ts/js server
* feat(ts-sdk): added support for test coverage
* docs(ts-sdk): adding example for testing framework
* docs(ts-sdk): adding example for testing framework
* docs(ts-sdk): adding example for testing framework
* feat(ts-sdk): added support for test coverage
* fix: merge conflicts
* fix: merge conflicts
* commiting
* docs(ts-sdk): updating readme
Signed-off-by: Pradhyuman-sharma <sharmapuru0642@gmail.com>
Signed-off-by: Pradhyuman-sharma <sharmapuru0642@gmail.com>
Co-authored-by: re-Tick <jain.ritik.1001@gmail.com>
Co-authored-by: Rajat Sharma <lunasunkaiser@gmail.com>
Signed-off-by: iamskp99 <iamskp99@gmail.com>
* chore: adds spaces
Signed-off-by: iamskp99 <iamskp99@gmail.com>
* feat: add test export
Signed-off-by: iamskp99 <iamskp99@gmail.com>
* feat: add feature to add custom mock export and test export path
Signed-off-by: iamskp99 <iamskp99@gmail.com>
* docs(update): add information about test and mock export
Signed-off-by: iamskp99 <iamskp99@gmail.com>
* docs(update): add information about test and mock export
Signed-off-by: iamskp99 <iamskp99@gmail.com>
* docs(update): add documentation of octokit
Signed-off-by: iamskp99 <iamskp99@gmail.com>
* docs(update): add documentation of octokit
Signed-off-by: iamskp99 <iamskp99@gmail.com>
* docs(update): add documentation of mock library
Signed-off-by: iamskp99 <iamskp99@gmail.com>
* feat: exports testcases and mocks as yaml files
Signed-off-by: iamskp99 <iamskp99@gmail.com>
* fix: removes package-lock.json
Signed-off-by: iamskp99 <iamskp99@gmail.com>
* fix: yarn.lock
Signed-off-by: iamskp99 <iamskp99@gmail.com>
Signed-off-by: iamskp99 <iamskp99@gmail.com>
Signed-off-by: Pradhyuman-sharma <sharmapuru0642@gmail.com>
Co-authored-by: Pradhyuman Sharma <90783566+Pradhyuman-sharma@users.noreply.github.com>
Co-authored-by: re-Tick <jain.ritik.1001@gmail.com>
Co-authored-by: Rajat Sharma <lunasunkaiser@gmail.com>
console.log(`Example app listening on port 3000!`));
45
+
module.exports= server;
46
+
```
47
+
32
48
## Configure
33
49
```
34
50
export KEPLOY_MODE="test"
35
51
export KEPLOY_APP_NAME="my-app"
36
52
export KEPLOY_APP_HOST="localhost"
37
53
export KEPLOY_APP_PORT=5050 # port on which server is running
38
54
export KEPLOY_APP_DELAY=5 # time delay before starting testruns(in seconds)
39
-
export KEPLOY_APP_TIMEOUT=100 # should be number
55
+
export KEPLOY_APP_TIMEOUT=100 # should be number
40
56
# export KEPLOY_APP_FILTER={"urlRegex":"*"} # should be json not to capture for certain url's
41
57
42
58
export KEPLOY_SERVER_URL="http://localhost:8081/api" # self hosted keploy running server
@@ -50,11 +66,22 @@ There are 3 modes:
50
66
51
67
**Note:**`KEPLOY_MODE` value is case sensitive.
52
68
53
-
## Supported Frameworks
69
+
## Generate E2E tests (with mocks)
70
+
71
+
```
72
+
export KEPLOY_TEST_CASE_PATH="./example" # If KEPLOY_TEST_CASE_PATH is not provided then a folder named keploy-tests will be made containing mocks folder. If KEPLOY_MOCK_PATH is provided then the mocks will be generated there.
73
+
export KEPLOY_MOCK_PATH="./exampleMockPath"
74
+
```
75
+
76
+
**Note:** To enable `Test Export`, add `export ENABLE_TEST_EXPORT=true` in your .env file of [keploy-server](https://github.com/keploy/keploy) repository. If enabled, yaml files containing test cases will be generated in the directory provided by the user. Similarly, mocks will be generated in the yaml files.
These statements should be at the top of your main file (server.js).
112
+
113
+
Note:- Import statements can't be used. Only CommonJs support is currently provided.
75
114
## Development Setup
76
115
77
116
- This project uses [Yarn](https://yarnpkg.com/) for package management. To install yarn, please make sure [Node](https://nodejs.org/en/) is installed and then:
@@ -86,6 +125,40 @@ npm i -g yarn
86
125
yarn install
87
126
```
88
127
128
+
### How to use mock library
129
+
130
+
The external calls from unit tests will be recorded and replayed as mocks from yaml files under a directory named mocks.
131
+
132
+
Following is an example of unit test with octokit :
0 commit comments