Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to import 'describe', 'expect' and 'it' into a typescript tests for IDE to not to highlight them

Wrote some tests and everything successfully runs, but my IDE (webstorm) highlights describe, expect and it and says "cannot find name". I want to keep everythig clean and get rid of these, but have no idea how.

We use protractor and jasmine.

enter image description here

Some more of the script:

import {HomePO} from './pageobjects/home'
import {browser } from 'protractor'


describe('Smoke test', function() {

    it('should initialize', function() {
        let width = 320;
        let height = 568;
        browser.driver.manage().window().setSize(width, height);
    });

    it('should open homepage', function() {
        HomePO.get();
        expect(HomePO.isCurrentPage()).toBe(true);
    });
});
like image 952
raitisd Avatar asked Dec 14 '16 13:12

raitisd


1 Answers

I was having the same problem and did:

 npm install @types/jasmine --save-dev

and that solved it - no need to import anything from jasmine.

like image 82
funnydog Avatar answered Dec 11 '22 07:12

funnydog