test: add automated tests for starting a recording #1422
Annotations
10 errors
|
src/main/script.test.ts > browser options > should not inject browser options when browser module is not imported:
src/main/script.test.ts#L215
Error: Snapshot `browser options > should not inject browser options when browser module is not imported 1` mismatched
- Expected
+ Received
@@ -2,8 +2,12 @@
export function handleSummary() {
console.log("This is the handleSummary shim");
}
export const options = {
scenarios: {
- default: { executor: "shared-iterations", vus: 1, iterations: 1 },
+ default: {
+ executor: "shared-iterations",
+ vus: 1,
+ iterations: 1
+ }
- },
+ }
};
❯ src/main/script.test.ts:215:5
|
|
src/main/script.test.ts > browser options > should inject browser options when browser module is imported:
src/main/script.test.ts#L200
Error: Snapshot `browser options > should inject browser options when browser module is imported 1` mismatched
- Expected
+ Received
import browser from "k6/browser";
-
export default function () {}
export function handleSummary() {
console.log("This is the handleSummary shim");
}
export const options = {
scenarios: {
default: {
executor: "shared-iterations",
vus: 1,
iterations: 1,
- options: { browser: { type: "chromium" } },
+ options: {
+ browser: {
+ type: "chromium"
+ }
+ }
- },
+ }
- },
+ }
};
❯ src/main/script.test.ts:200:5
|
|
src/main/script.test.ts > options export > should rename options export when exported in a complex way:
src/main/script.test.ts#L181
Error: Snapshot `options export > should rename options export when exported in a complex way 1` mismatched
- Expected
+ Received
- export const { abc: $c26e2908c2e948ef883369abc050ce2f } = {
+ export const {abc: $c26e2908c2e948ef883369abc050ce2f} = {
$c26e2908c2e948ef883369abc050ce2f: {
vus: 10,
- duration: "10s",
+ duration: "10s"
- },
+ }
};
-
export default function () {}
export function handleSummary() {
console.log("This is the handleSummary shim");
}
export const options = {
scenarios: {
- default: { executor: "shared-iterations", vus: 1, iterations: 1 },
+ default: {
+ executor: "shared-iterations",
+ vus: 1,
+ iterations: 1
+ }
- },
+ }
};
❯ src/main/script.test.ts:181:5
|
|
src/main/script.test.ts > options export > should rename any existing options export to avoid collision with the inject one:
src/main/script.test.ts#L158
Error: Snapshot `options export > should rename any existing options export to avoid collision with the inject one 1` mismatched
- Expected
+ Received
export const $c26e2908c2e948ef883369abc050ce2f = {
vus: 10,
- duration: "10s",
+ duration: "10s"
};
-
export default function () {}
export function handleSummary() {
console.log("This is the handleSummary shim");
}
export const options = {
scenarios: {
- default: { executor: "shared-iterations", vus: 1, iterations: 1 },
+ default: {
+ executor: "shared-iterations",
+ vus: 1,
+ iterations: 1
+ }
- },
+ }
};
❯ src/main/script.test.ts:158:5
|
|
src/main/script.test.ts > options export > should export options object when no options are exported:
src/main/script.test.ts#L139
Error: Snapshot `options export > should export options object when no options are exported 1` mismatched
- Expected
+ Received
@@ -2,8 +2,12 @@
export function handleSummary() {
console.log("This is the handleSummary shim");
}
export const options = {
scenarios: {
- default: { executor: "shared-iterations", vus: 1, iterations: 1 },
+ default: {
+ executor: "shared-iterations",
+ vus: 1,
+ iterations: 1
+ }
- },
+ }
};
❯ src/main/script.test.ts:139:5
|
|
src/main/script.test.ts > groups shim > should keep existing execution import if it has a different name:
src/main/script.test.ts#L123
Error: Snapshot `groups shim > should keep existing execution import if it has a different name 1` mismatched
- Expected
+ Received
import http from "k6/http";
(function () {
console.log("This is the groups shim");
})();
import myExec from "k6/execution";
-
export default function () {}
export function handleSummary() {
console.log("This is the handleSummary shim");
}
export const options = {
scenarios: {
- default: { executor: "shared-iterations", vus: 1, iterations: 1 },
+ default: {
+ executor: "shared-iterations",
+ vus: 1,
+ iterations: 1
+ }
- },
+ }
};
❯ src/main/script.test.ts:123:5
|
|
src/main/script.test.ts > groups shim > should not inject groups shim when http module is not imported:
src/main/script.test.ts#L106
Error: Snapshot `groups shim > should not inject groups shim when http module is not imported 1` mismatched
- Expected
+ Received
@@ -2,8 +2,12 @@
export function handleSummary() {
console.log("This is the handleSummary shim");
}
export const options = {
scenarios: {
- default: { executor: "shared-iterations", vus: 1, iterations: 1 },
+ default: {
+ executor: "shared-iterations",
+ vus: 1,
+ iterations: 1
+ }
- },
+ }
};
❯ src/main/script.test.ts:106:5
|
|
src/main/script.test.ts > groups shim > should inject groups shim when http module is imported:
src/main/script.test.ts#L92
Error: Snapshot `groups shim > should inject groups shim when http module is imported 1` mismatched
- Expected
+ Received
@@ -1,7 +1,6 @@
import http from "k6/http";
-
(function () {
console.log("This is the groups shim");
})();
export default function () {
http.get("http://test.k6.io");
@@ -9,8 +8,12 @@
export function handleSummary() {
console.log("This is the handleSummary shim");
}
export const options = {
scenarios: {
- default: { executor: "shared-iterations", vus: 1, iterations: 1 },
+ default: {
+ executor: "shared-iterations",
+ vus: 1,
+ iterations: 1
+ }
- },
+ }
};
❯ src/main/script.test.ts:92:5
|
|
src/main/script.test.ts > checks shim > should not inject handleSummary export when it has already been exported:
src/main/script.test.ts#L72
Error: Snapshot `checks shim > should not inject handleSummary export when it has already been exported 1` mismatched
- Expected
+ Received
- import { check } from "k6";
+ import {check} from "k6";
-
export function handleSummary() {
console.log("This is the user-defined handleSummary function");
}
-
export default function () {
check(true, {
- "is true": (value) => value === true,
+ 'is true': value => value === true
});
}
export const options = {
scenarios: {
- default: { executor: "shared-iterations", vus: 1, iterations: 1 },
+ default: {
+ executor: "shared-iterations",
+ vus: 1,
+ iterations: 1
+ }
- },
+ }
};
❯ src/main/script.test.ts:72:5
|
|
src/main/script.test.ts > checks shim > should inject handleSummary export:
src/main/script.test.ts#L48
Error: Snapshot `checks shim > should inject handleSummary export 1` mismatched
- Expected
+ Received
- import { check } from "k6";
+ import {check} from "k6";
-
export default function () {
check(true, {
- "is true": (value) => value === true,
+ 'is true': value => value === true
});
}
export function handleSummary() {
console.log("This is the handleSummary shim");
}
export const options = {
scenarios: {
- default: { executor: "shared-iterations", vus: 1, iterations: 1 },
+ default: {
+ executor: "shared-iterations",
+ vus: 1,
+ iterations: 1
+ }
- },
+ }
};
❯ src/main/script.test.ts:48:5
|