This commit is contained in:
dntzhang 2020-09-30 09:14:26 +08:00
parent cf180c16bb
commit 85f53a74c6
1 changed files with 52 additions and 0 deletions

View File

@ -0,0 +1,52 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Test Suite</title>
<link rel="stylesheet" href="./lib/qunit.css">
</head>
<body>
<div id="qunit"></div>
<div id="qunit-fixture"></div>
<script src="./lib/qunit.js"></script>
<script src="../index.js"></script>
<script>
QUnit.module('obaa', function () {
QUnit.test("simple", function (assert) {
const items = [{ a: 1 }]
const currentItem = {
items,
b: 1
}
const data = { items, currentItem }
obaa(data, (a, b, c, d) => {
console.log(a, b, c, d)
})
// data.currentItem.b = 2
// items[0] = 111
//可以触发
data.currentItem.items[0] = 222
assert.deepEqual(1, 1)
})
});
</script>
</body>
</html>