Skip to content

Commit d3ef32c

Browse files
author
David Haeffner
committed
Fix for assert/verify
1 parent afcb143 commit d3ef32c

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

packages/code-export-javascript-mocha/__test__/src/__snapshots__/index.spec.js.snap

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ describe('control flow', function() {
6161
} else {
6262
vars[\\"output\\"] = await driver.executeScript(\\"return 'c'\\")
6363
}
64-
assert(vars[\\"output\\"] == \\"a\\")
64+
assert(vars[\\"output\\"].toString() == \\"a\\")
6565
})
6666
it('control flow else if', async function() {
6767
vars[\\"myVar\\"] = await driver.executeScript(\\"return 'b'\\")
@@ -72,7 +72,7 @@ describe('control flow', function() {
7272
} else {
7373
vars[\\"output\\"] = await driver.executeScript(\\"return 'c'\\")
7474
}
75-
assert(vars[\\"output\\"] == \\"b\\")
75+
assert(vars[\\"output\\"].toString() == \\"b\\")
7676
})
7777
it('control flow else', async function() {
7878
vars[\\"myVar\\"] = await driver.executeScript(\\"return 'c'\\")
@@ -83,29 +83,29 @@ describe('control flow', function() {
8383
} else {
8484
vars[\\"output\\"] = await driver.executeScript(\\"return 'c'\\")
8585
}
86-
assert(vars[\\"output\\"] == \\"c\\")
86+
assert(vars[\\"output\\"].toString() == \\"c\\")
8787
})
8888
it('control flow do', async function() {
8989
vars[\\"check\\"] = await driver.executeScript(\\"return 1\\")
9090
do {
9191
vars[\\"check\\"] = await driver.executeScript(\\"return arguments[0] + 1\\", vars[\\"check\\"])
9292
} while(!!await driver.executeScript(\\"return (arguments[0] < 3)\\", vars[\\"check\\"]))
93-
assert(vars[\\"check\\"] == \\"3\\")
93+
assert(vars[\\"check\\"].toString() == \\"3\\")
9494
})
9595
it('control flow times', async function() {
9696
vars[\\"check\\"] = await driver.executeScript(\\"return 1\\")
9797
const times = 2
9898
for(let i = 0; i < times; i++) {
9999
vars[\\"check\\"] = await driver.executeScript(\\"return arguments[0] + 1\\", vars[\\"check\\"])
100100
}
101-
assert(vars[\\"check\\"] == \\"3\\")
101+
assert(vars[\\"check\\"].toString() == \\"3\\")
102102
})
103103
it('control flow while', async function() {
104104
vars[\\"check\\"] = await driver.executeScript(\\"return 1\\")
105105
while(!!await driver.executeScript(\\"return (arguments[0] < 3)\\", vars[\\"check\\"])) {
106106
vars[\\"check\\"] = await driver.executeScript(\\"return arguments[0] + 1\\", vars[\\"check\\"])
107107
}
108-
assert(vars[\\"check\\"] == \\"3\\")
108+
assert(vars[\\"check\\"].toString() == \\"3\\")
109109
})
110110
})
111111
"

packages/code-export-javascript-mocha/__test__/src/command.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ describe('command code emitter', () => {
6868
value: 'blah',
6969
}
7070
expect(prettify(command)).resolves.toBe(
71-
`assert(vars["varrrName"] == "blah")`
71+
`assert(vars["varrrName"].toString() == "blah")`
7272
)
7373
})
7474
it('should emit `assert alert` command', () => {
@@ -822,7 +822,7 @@ describe('command code emitter', () => {
822822
value: 'blah',
823823
}
824824
expect(prettify(command)).resolves.toBe(
825-
`assert(vars["varrrName"] == "blah")`
825+
`assert(vars["varrrName"].toString() == "blah")`
826826
)
827827
})
828828
it('should emit `verify checked` command', () => {

packages/code-export-javascript-mocha/src/command.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ async function emitNewWindowHandling(command, emittedCommand) {
186186
}
187187

188188
function emitAssert(varName, value) {
189-
return Promise.resolve(`assert(vars["${varName}"] == "${value}")`)
189+
return Promise.resolve(`assert(vars["${varName}"].toString() == "${value}")`)
190190
}
191191

192192
function emitAssertAlert(alertText) {

0 commit comments

Comments
 (0)