-
Notifications
You must be signed in to change notification settings - Fork 685
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Verify vsix size before release (#2144)
* Verify vsix size before release * Remove istanbul from shipping payload
- Loading branch information
Piotr Puszkiewicz
authored
Mar 29, 2018
1 parent
a59273b
commit 0514e83
Showing
4 changed files
with
43 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
--ui tdd | ||
--require source-map-support/register | ||
--require ts-node/register | ||
|
||
test/unitTests/**/*.test.@(ts|tsx) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* 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 maximumVsixSizeInBytes = 5 * 1024 * 1024; | ||
|
||
suite(`Given ${element}`, () => { | ||
test(`Then its size is less than 1MB`, async () => { | ||
const stats = await fs.stat(element); | ||
stats.size.should.be.lessThan(maximumVsixSizeInBytes); | ||
}); | ||
|
||
test(`Then it should not be empty`, async () => { | ||
const stats = await fs.stat(element); | ||
stats.size.should.be.greaterThan(0); | ||
}); | ||
}); | ||
}); | ||
}); |