suiteSetup(() => {
     chai.should();
     tmpDir = tmp.dirSync();
     let args: string[] = [];
     args.push(path.join("node_modules", "gulp", "bin", "gulp.js"));
     args.push("package:offline");
     args.push("--retainVsix");// do not delete the existing vsix in the repo
     args.push(`-o`);
     args.push(tmpDir.name);
     invokeNode(args);
     vsixFiles = glob.sync(path.join(tmpDir.name, '*.vsix'));
 });
function loadFiles(projectRoot: string, modelsDir: string): string[] {
  // this should be in options
  return glob.sync(path.resolve(projectRoot, modelsDir));
}
function loadRepoFiles(projectRoot: string): string[] {
  // this should be in options
  return glob.sync(projectRoot + '/repositories/*.repository.js');
}
Example #4
0
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

import * as chai from 'chai';
import * as fs from 'async-file';
import * as glob from 'glob-promise';
import * as path from 'path';

let vsixFiles = glob.sync(path.join(process.cwd(), '**', '*.vsix'));

suite("Omnisharp-Vscode VSIX", async () => {
    suiteSetup(async () => {
        chai.should();

    });

    test("At least one vsix file should be produced", () => {
        vsixFiles.length.should.be.greaterThan(0, "the build should produce at least one vsix file");
    });

    vsixFiles.forEach(element => {
        const sizeInMB = 5;
        const maximumVsixSizeInBytes = sizeInMB * 1024 * 1024;

        suite(`Given ${element}`, () => {
            test(`Then its size is less than ${sizeInMB}MB`, async () => {
                const stats = await fs.stat(element);
                stats.size.should.be.lessThan(maximumVsixSizeInBytes);
            });