protractor icon indicating copy to clipboard operation
protractor copied to clipboard

SyntaxError: Unexpected token ILLEGAL at exports.runInThisContext (vm.js:73:16) at Module._compile (module.js:443:25) at Object.Module._extensions..js (module.js:478:10) at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12) at Module.require (module.js:365:17) at require (module.js:384:17) at /Users/ahmeds6/local/node/lib/node_modules/protractor/node_modules/jasmine/lib/jasmine.js:63:5 at Array.forEach (native) at Jasmine.loadSpecs (/Users/ahmeds6/local/node/lib/node_modules/protractor/node_modules/jasmine/lib/jasmine.js:62:18) [launcher] Process exited with error code 100

Open ahmedusa opened this issue 11 years ago • 2 comments

can anyone help me with the following issue:

SyntaxError: Unexpected token ILLEGAL at exports.runInThisContext (vm.js:73:16) at Module._compile (module.js:443:25) at Object.Module._extensions..js (module.js:478:10) at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12) at Module.require (module.js:365:17) at require (module.js:384:17) at /Users/ahmeds6/local/node/lib/node_modules/protractor/node_modules/jasmine/lib/jasmine.js:63:5 at Array.forEach (native) at Jasmine.loadSpecs (/Users/ahmeds6/local/node/lib/node_modules/protractor/node_modules/jasmine/lib/jasmine.js:62:18) [launcher] Process exited with error code 100

I am using protractor and jasmine: here is the config file:

exports.config = { seleniumAddress: 'http://localhost:4444/wd/hub', capabilities: { 'browserName' : 'firefox', shardTestFiles: true, }, baseUrl: 'http://test.com/',

allScriptsTimeout: 2000,
getPageTimeout: 2000,

framework: 'cucumber',
framework: "jasmine2",

specs: [
 'features/tests.feature'
],

framework: 'jasmine2',

onPrepare: function() {
    var jasmineReporters = require('jasmine-reporters');

    // returning the promise makes protractor wait for the reporter config before executing tests
    return browser.getProcessedConfig().then(function(config) {
        // you could use other properties here if you want, such as platform and version
        var browserName = config.capabilities.browserName;

        var junitReporter = new jasmineReporters.JUnitXmlReporter({
            consolidateAll: true,
            savePath: 'test/reports/',
            // this will produce distinct xml files for each capability
            filePrefix: browserName + '-xmloutput',
            modifySuiteName: function(generatedSuiteName, suite) {
                // this will produce distinct suite names for each capability,
                // e.g. 'firefox.login tests' and 'chrome.login tests'
                return browserName + '.' + generatedSuiteName;
            }
        });
        jasmine.getEnv().addReporter(junitReporter);
    });
},

jasmineNodeOpts: {
    showColors: true,
    isVerbose: true,
    includeStackTrace: true,
    defaultTimeoutInterval: 30000
},


cucumberOpts: {
    format: 'pretty',
},

};

ahmedusa avatar Oct 08 '15 20:10 ahmedusa

Hi there!

Your question is better suited for StackOverflow or Gitter. Please ask a question there with the 'protractor' tag or post in the Gitter Channel to get help.

From the the getting help section of the README:

Please ask usage and debugging questions on StackOverflow (use the "protractor" tag) or in the Angular discussion group. (Please do not ask support questions here on Github.)

As a side note, please try to keep the titles of issues readable, and properly format any code snippets.

NickTomlin avatar Oct 08 '15 21:10 NickTomlin

I am also seeing this error when I am trying to test a non-angular page and expect some text on the page.

expect(element.all(by.className('body-copy')).get(39).getText()).toBe('');

mohitgpt24 avatar Oct 06 '16 22:10 mohitgpt24