Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve flakey test #7909

Merged
merged 4 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
256 changes: 0 additions & 256 deletions packages/insomnia-inso/src/__snapshots__/inso-snapshot.test.ts.snap

This file was deleted.

4 changes: 2 additions & 2 deletions packages/insomnia-inso/src/cli.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ const shouldReturnSuccessCode = [
'$PWD/packages/insomnia-inso/bin/inso run test -w packages/insomnia-inso/src/db/fixtures/nedb -e env_env_ca046a --reporter min uts_fe901c',
'$PWD/packages/insomnia-inso/bin/inso run test -w packages/insomnia-inso/src/db/fixtures/git-repo -e env_env_ca046a uts_fe901c',
'$PWD/packages/insomnia-inso/bin/inso run test -w packages/insomnia-inso/src/db/fixtures/insomnia-v4/insomnia_v4.yaml -e env_env_0e4670 spc_3b2850',
// export file,request can inherit auth headers and variables from folder
'$PWD/packages/insomnia-inso/bin/inso run test -w packages/insomnia-inso/src/examples/folder-inheritance-document.yml spc_a8144e --verbose',
// export file, request can inherit auth headers and variables from folder, also test --disableCertValidation with local https smoke test server
'$PWD/packages/insomnia-inso/bin/inso run test -w packages/insomnia-inso/src/examples/folder-inheritance-document.yml spc_a8144e --verbose --disableCertValidation',

// run collection
// export file
Expand Down
2 changes: 1 addition & 1 deletion packages/insomnia-inso/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ export const go = (args?: string[]) => {
.description('Run Insomnia request collection, identifier can be a workspace id')
.option('-t, --requestNamePattern <regex>', 'run requests that match the regex', '')
.option('-e, --env <identifier>', 'environment to use', '')
.option('-b, --bail', 'abort ("bail") after first test failure', false)
.option('-b, --bail', 'abort ("bail") after first non-200 response', false)
.option('--disableCertValidation', 'disable certificate validation for requests with SSL', false)
.action(async (identifier, cmd: { env: string; disableCertValidation: true; requestNamePattern: string; bail: boolean }) => {
const globals: { config: string; workingDir: string; exportFile: string; ci: boolean; printOptions: boolean; verbose: boolean } = program.optsWithGlobals();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ resources:
parentId: fld_7ca9aeafb2714bc287e33f643299c271
modified: 1720533313731
created: 1720531712225
url: httpbin.org/anything
url: https://localhost:4011/echo
name: New Request
description: ""
method: GET
Expand Down Expand Up @@ -106,11 +106,15 @@ resources:
name: Returns 200
code: |-
const response1 = await insomnia.send();
// console.log(response1.data)
const timelineString = await require('fs/promises').readFile(response1.timelinePath, 'utf8');
const timeline = timelineString.split('\n').filter(e => e?.trim()).map(e => JSON.parse(e).value).join(' ');
console.log(timeline);

const body = JSON.parse(response1.data)
console.log(body.headers)
expect(response1.status).to.equal(200);
expect(body.data).to.equal('bar')
expect(body.headers.Customheader).to.equal('jack')
expect(body.headers.Authorization).to.equal('Basic YWRtaW46cGFzc3dvcmQ=')
expect(body.headers.customheader).to.equal('jack')
expect(body.headers.authorization).to.equal('Basic YWRtaW46cGFzc3dvcmQ=')
metaSortKey: -1720533328458
_type: unit_test
Loading