JSHint thinks Jasmine functions are undefined

前端 未结 4 2070
自闭症患者
自闭症患者 2020-12-29 20:34

I\'ve got a Grunt setup which uses Karma+Jasmine and JSHint. Whenever I run JSHint on my spec file, I get a series of \"undefined\" errors, most of which are for Jasmine\'s

4条回答
  •  旧巷少年郎
    2020-12-29 21:11

    I fixed this in Gruntfile.js adding jasmine: true to the options of the jshint task:

    jshint:
    {
        options:
        {
            ...
            node: true,
            jasmine: true,
            ...
        },
        ...
    },
    

    Like the OP, I'm not using a .jshintrc file either.

提交回复
热议问题