diff --git a/notifications-sample/CHANGELOG.md b/notifications-sample/CHANGELOG.md deleted file mode 100644 index fec46ce4..00000000 --- a/notifications-sample/CHANGELOG.md +++ /dev/null @@ -1,9 +0,0 @@ -# Change Log - -All notable changes to the "notifications-sample" extension will be documented in this file. - -Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file. - -## [Unreleased] - -- Initial release \ No newline at end of file diff --git a/notifications-sample/README.md b/notifications-sample/README.md index a17bf0af..8e7e59fb 100644 --- a/notifications-sample/README.md +++ b/notifications-sample/README.md @@ -28,10 +28,11 @@ This sample showcases a handful of basic configurations for notifications in VS ## Running the Sample - Run `npm install` in terminal to install dependencies -- Run the `Run Extension` target in the Debug View. This will: +- Press F5 or Run the `Run Extension` target in the Debug View. This will: - Start a task `npm: watch` to compile the code - Run the extension in a new VS Code window - Try running the commands to show the notifications: + ``` - Notifications Sample: Show Info Notification - Notifications Sample: Show Info Notification as Modal @@ -39,6 +40,3 @@ This sample showcases a handful of basic configurations for notifications in VS - Notifications Sample: Show Warning Notification with Actions - Notifications Sample: Show Progress Notification ``` - - - diff --git a/notifications-sample/package.json b/notifications-sample/package.json index 6349d2d3..e0960c19 100644 --- a/notifications-sample/package.json +++ b/notifications-sample/package.json @@ -57,8 +57,7 @@ "compile": "tsc -p ./", "watch": "tsc -watch -p ./", "pretest": "npm run compile && npm run lint", - "lint": "eslint src --ext ts", - "test": "node ./out/test/runTest.js" + "lint": "eslint src --ext ts" }, "devDependencies": { "@types/vscode": "^1.69.0", diff --git a/notifications-sample/src/test/runTest.ts b/notifications-sample/src/test/runTest.ts deleted file mode 100644 index 27b3ceb2..00000000 --- a/notifications-sample/src/test/runTest.ts +++ /dev/null @@ -1,23 +0,0 @@ -import * as path from 'path'; - -import { runTests } from '@vscode/test-electron'; - -async function main() { - try { - // The folder containing the Extension Manifest package.json - // Passed to `--extensionDevelopmentPath` - const extensionDevelopmentPath = path.resolve(__dirname, '../../'); - - // The path to test runner - // Passed to --extensionTestsPath - const extensionTestsPath = path.resolve(__dirname, './suite/index'); - - // Download VS Code, unzip it and run the integration test - await runTests({ extensionDevelopmentPath, extensionTestsPath }); - } catch (err) { - console.error('Failed to run tests'); - process.exit(1); - } -} - -main(); diff --git a/notifications-sample/src/test/suite/extension.test.ts b/notifications-sample/src/test/suite/extension.test.ts deleted file mode 100644 index 4ca0ab41..00000000 --- a/notifications-sample/src/test/suite/extension.test.ts +++ /dev/null @@ -1,15 +0,0 @@ -import * as assert from 'assert'; - -// You can import and use all API from the 'vscode' module -// as well as import your extension to test it -import * as vscode from 'vscode'; -// import * as myExtension from '../../extension'; - -suite('Extension Test Suite', () => { - vscode.window.showInformationMessage('Start all tests.'); - - test('Sample test', () => { - assert.strictEqual(-1, [1, 2, 3].indexOf(5)); - assert.strictEqual(-1, [1, 2, 3].indexOf(0)); - }); -}); diff --git a/notifications-sample/src/test/suite/index.ts b/notifications-sample/src/test/suite/index.ts deleted file mode 100644 index 7029e38e..00000000 --- a/notifications-sample/src/test/suite/index.ts +++ /dev/null @@ -1,38 +0,0 @@ -import * as path from 'path'; -import * as Mocha from 'mocha'; -import * as glob from 'glob'; - -export function run(): Promise { - // Create the mocha test - const mocha = new Mocha({ - ui: 'tdd', - color: true - }); - - const testsRoot = path.resolve(__dirname, '..'); - - return new Promise((c, e) => { - glob('**/**.test.js', { cwd: testsRoot }, (err, files) => { - if (err) { - return e(err); - } - - // Add files to the test suite - files.forEach(f => mocha.addFile(path.resolve(testsRoot, f))); - - try { - // Run the mocha test - mocha.run(failures => { - if (failures > 0) { - e(new Error(`${failures} tests failed.`)); - } else { - c(); - } - }); - } catch (err) { - console.error(err); - e(err); - } - }); - }); -}