0

I have install spectron using the following command npm install -g spectron

but i am unable to run globally. So I install locally as you said. have installed Jasmine and i have specified test scrips as jasmine in package.json

var Application = require('spectron').Application
var assert = require('assert')
var jasmine = require('jasmine')

describe('application launch', function () {
  beforeEach(function () {
    this.app = new Application({
        path: 'C:\\Users\\ramass11\\AppData\\Local\\Programs\\ng-site-solutions\\ng-site-solutions.exe'
     })
    return this.app.start()
  })
})

If I run my script using the command node First.js, I am getting "describe is not defined"

I want to know why i am getting this error and whether the way i am importing the jasmine is right ?

2 Answers2

0

It could be that you are missing the TypeScript definitions for Jasmine. Have you added "@types/jasmine": "2.6.0" to your package.json file under devDependencies?

If not run npm install --save @types/jasmine

Matthias Sommer
  • 1,070
  • 13
  • 28
0

You should run your test with some kind of test runner (which defines describe and it), I would recommend mocha in this case.

npm install mocha --save-dev
node_modules/.bin/mocha First.js
kontrollanten
  • 2,649
  • 19
  • 32