尝试打开.js文件时出现错误对象预期

时间:2020-02-04 03:54:53

标签: javascript

我非常绿,所以请忍受我。

我正在尝试打开.js文件,并收到以下消息。

行:4 字符:1 错误:预期对象 编码:800A138F 来源:Microsoft JScript运行时错误

请参阅下面的完整代码。我不知道我需要添加/更改什么。提前致谢。我留下了评论。

 * @fileOverview A sample script to demonstrate parallel collection runs using async.
 */
var path = require('path'), // ensures that the path is consistent, regardless of where the script is run from

    async = require('async'), // https://npmjs.org/package/async
    newman = require('../'), // change to require('newman'), if using outside this repository

    /**
     * A set of collection run options for the paralle collection runs. For demonstrative purposes in this script, an
     * identical set of options has been used. However, different options can be used, so as to actually run different
     * collections, with their corresponding run options in parallel.
     *
     * @type {Object}
     */
    options = {
        collection: path.join('C:\\Users\\conni\\Desktop', 'sample-collection.json')
    },

    /**
     * A collection runner function that runs a collection for a pre-determined options object.
     *
     * @param {Function} done - A callback function that marks the end of the current collection run, when called.
     */
    parallelCollectionRun = function (done) {
        newman.run(options, done);
    };

// Runs the Postman sample collection thrice, in parallel.
async.parallel([
    parallelCollectionRun,
    parallelCollectionRun,
    parallelCollectionRun
],

/**
 * The
 *
 * @param {?Error} err - An Error instance / null that determines whether or not the parallel collection run
 * succeeded.
 * @param {Array} results - An array of collection run summary objects.
 */
function (err, results) {
    err && console.error(err);

    results.forEach(function (result) {
        var failures = result.run.failures;

        console.info(failures.length ? JSON.stringify(failures.failures, null, 2) :
            '${result.collection.name} ran successfully.');
    });
});

0 个答案:

没有答案