客户端上的“测试未定义”笑话/期望

时间:2018-09-25 06:10:36

标签: javascript unit-testing testing browser jestjs

我在浏览器上收到“未定义测试” Uncaught ReferenceError。

我不使用ESLINT,根据this link,它是“未定义测试”的解决方案。 “ test”是在jest / expect测试库中全局设置的,预计在test.html中包含Expect.min.js文件之后才能使用。

In that case what could be the other reasons and their solution.

here is my code:
    <script src="https://unpkg.com/expect@%3C21/umd/expect.min.js"></script>
    <script src='script.js'></script>
    <script>
      test('myTest', () => {
        a = {}
        b = {}
        a.rating = 1
        b.rating = 2
        expect(sortAlgo(a,b)).toBe(1)
      })
   </script>

0 个答案:

没有答案