Skip to content

Commit

Permalink
Test for supported extension check
Browse files Browse the repository at this point in the history
- Added:
  - `Supported dependent extension check` test:  
     Test the situation when non of the extensions listed in `haskutil.supportedDependencies` setting are currently installed
  • Loading branch information
EduardSergeev committed Sep 1, 2023
2 parents 4ab528e + 946d93a commit f9a7950
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 15 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Change Log
All notable changes to the "Haskutil" extension will be documented in this file.

## [0.12.3] - 2023-08-31
### Added
* `Supported dependent extension check` test:
Test the situation when non of the extensions listed in `haskutil.supportedDependencies` setting are currently installed

## [0.12.2] - 2023-08-31
### Changed
* `Dependency not installed` warning message extension links:
Expand Down
4 changes: 4 additions & 0 deletions input/after/OK.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

main :: IO ()
main =
return ()
4 changes: 4 additions & 0 deletions input/before/OK.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

main :: IO ()
main =
return ()
22 changes: 11 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "haskutil",
"displayName": "Haskutil",
"description": "'QuickFix' actions for Haskell editor",
"version": "0.12.2",
"version": "0.12.3",
"publisher": "Edka",
"repository": {
"url": "https://github.com/EduardSergeev/vscode-haskutil"
Expand Down Expand Up @@ -252,9 +252,9 @@
"@istanbuljs/nyc-config-typescript": "1.0.2",
"@types/chai": "4.3.5",
"@types/mocha": "10.0.1",
"@types/node": "20.5.0",
"@types/node": "20.5.7",
"@types/vscode": "1.48.0",
"@vscode/vsce": "2.20.1",
"@vscode/vsce": "2.21.0",
"@vscode/test-electron": "2.3.4",
"chai": "4.3.8",
"mocha": "10.2.0",
Expand Down
32 changes: 32 additions & 0 deletions src/test/extension.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import * as vscode from 'vscode';
import { runQuickfixTest, withTestDocument } from './utils';
import { DiagnosticSeverity } from 'vscode';

const configs = {
'haskutil.supportedDependencies': [{
id: 'invalid.id',
name: 'Some name'
}],
};

suite('', () => {
suiteSetup(async () => {
const config = vscode.workspace.getConfiguration();
for (const setting in configs) {
await config.update(setting, configs[setting], true);
}
});

test('Supported dependent extension check', () => {
return withTestDocument('OK.hs', [DiagnosticSeverity.Hint, 0], async doc => {
const d = doc;
});
});

suiteTeardown(async () => {
const config = vscode.workspace.getConfiguration();
for (const setting in configs) {
await config.update(setting, undefined, true);
}
});
});
2 changes: 1 addition & 1 deletion src/test/runTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ async function main(): Promise<number> {
// This is required for Mocha tests to report non-zero exit code in case of test failure
process.removeAllListeners('exit');

// Download VS Code, unzip it and run the integration test
// Download VS Code, unzip it and run all integration tests
return await runTests({
vscodeExecutablePath,
extensionDevelopmentPath,
Expand Down

0 comments on commit f9a7950

Please sign in to comment.