Created
December 28, 2018 06:08
-
-
Save matsub/c56b39779974db3a25058d8c13eea2b3 to your computer and use it in GitHub Desktop.
testcafeがLoose equalityをstrict equalityとして評価しているように見える
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Selector } from 'testcafe' | |
fixture `Loose Equality` | |
.page `http://localhost:8000/` | |
test('Say Hello', async t => { | |
const btn = Selector("button") | |
await t.click(btn) | |
// assertion | |
const p = Selector("p") | |
await t.expect(p.textContent).contains("hello", "yay, hello") | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<button>yabai</button> | |
<script> | |
document.querySelector("button").addEventListener('click', e => { | |
if (1 == '1') { | |
const elm = document.createElement("p") | |
elm.textContent = "hello" | |
document.body.appendChild(elm) | |
} else { | |
throw new Error("You're an idiot.") | |
} | |
}) | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment