如果之前的测试已经过去,是否可以仅在Jest中运行测试?我无法在文档中找到关于truthy回调的任何内容。例如:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Equalizer with Bi-Quad Filters</title>
</head>
<body>
<div class="eq">
<audio id="player" controls crossorigin="anonymous" loop></audio>
<div class="controls">
<label>60Hz</label>
<input type="range" value="0" step="1" min="-30" max="30" oninput="changeGain(this.value, 0);">
<output id="gain0">0 dB</output>
</div>
<div class="controls">
<label>170Hz</label>
<input type="range" value="0" step="1" min="-30" max="30" oninput="changeGain(this.value, 1);">
<output id="gain1">0 dB</output>
</div>
<div class="controls">
<label>350Hz</label>
<input type="range" value="0" step="1" min="-30" max="30" oninput="changeGain(this.value, 2);">
<output id="gain2">0 dB</output>
</div>
<div class="controls">
<label>1000Hz</label>
<input type="range" value="0" step="1" min="-30" max="30" oninput="changeGain(this.value, 3);">
<output id="gain3">0 dB</output>
</div>
<div class="controls">
<label>3500Hz</label>
<input type="range" value="0" step="1" min="-30" max="30" oninput="changeGain(this.value, 4);">
<output id="gain4">0 dB</output>
</div>
<div class="controls">
<label>10000Hz</label>
<input type="range" value="0" step="1" min="-30" max="30" oninput="changeGain(this.value, 5);">
<output id="gain5">0 dB</output>
</div>
</div>
</body>
</html>
琐碎的例子,但是&#34;第一项值&#34;是否可能?测试只运行&#34;数组长度&#34;测试已通过,没有只是执行以下操作
var array = [1, 2, 3, 4];
describe("Test task", () => {
test("array length", () => {
expect(array).toHaveLength(4);;
});
test("first item value", () => {
expect(array[0]).toBe(1);;
});
});