Skip to content

Instantly share code, notes, and snippets.

@ohze
Created April 17, 2019 18:38
Show Gist options
  • Save ohze/954b1c8a52320e48744b7b7cf72491fc to your computer and use it in GitHub Desktop.
Save ohze/954b1c8a52320e48744b7b7cf72491fc to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/dafijuqepi
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<link href="https://code.jquery.com/qunit/qunit-git.css" rel="stylesheet" type="text/css" />
<script src="https://code.jquery.com/qunit/qunit-git.js"></script>
</head>
<body>
<div id="qunit"></div>
<div id="qunit-fixture"></div>
<script id="jsbin-javascript">
function f() {
throw new Error('err');
}
function errCheck(e) {
return e.message == 'err';
}
QUnit.test('foo', (t) => {
t.throws(f, errCheck);
t.throws(f, (e) => e.message == 'err');
})
</script>
<script id="jsbin-source-javascript" type="text/javascript">function f() {
throw new Error('err');
}
function errCheck(e) {
return e.message == 'err';
}
QUnit.test('foo', (t) => {
t.throws(f, errCheck);
t.throws(f, (e) => e.message == 'err');
})</script></body>
</html>
function f() {
throw new Error('err');
}
function errCheck(e) {
return e.message == 'err';
}
QUnit.test('foo', (t) => {
t.throws(f, errCheck);
t.throws(f, (e) => e.message == 'err');
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment