-
Notifications
You must be signed in to change notification settings - Fork 6
Back end mocking with teremock #53
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please solve merge conflicts.
let mocker = new RequestMocker(); | ||
let helpers = new Helpers(); | ||
|
||
it("Recording all requests and replaying it on the second test run google", async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
await mocker.stop(); | ||
|
||
//Assert | ||
expect(fs.existsSync("mockData\\Request mocking by recording and replaying and indercetipt specific requests\\Recording all requests and replaying it on the second test run google\\interceptors\\get.json")).toBe(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use "/" slashes to be cross-platform and consistent with other paths in framework
await mocker.stop(); | ||
|
||
//Assert | ||
expect(fs.existsSync("mockData\\Request mocking by recording and replaying and indercetipt specific requests\\Recording all requests and replaying it on the second test run google\\interceptors\\get.json")).toBe(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Path should be updated according to describe: "Request mocking by recording and replaying and indercetipt specific requests" > "Request mocking by recording and replaying specific requests"
const targetDir = `./mockData/${jasmine["currentSuite"].fullName}/${jasmine["currentTest"].description}`; | ||
await teremock.start({ page, wd: targetDir, interceptors: { interceptors } }); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no constructor, class should be refactored to single ton pattern, like i.e.: https://github.com/devbridge/test-juggler/blob/master/framework/interceptor.js
Added helper class requestMocker into framework
Added sample tests - requestMocking.test.js
Added documentation to Readme