Skip to content

Commit

Permalink
chore: put back test suite 1
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardomourar committed Sep 21, 2022
1 parent 347198e commit 8987d63
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 12 deletions.
3 changes: 0 additions & 3 deletions test-fixtures/suite1/.vscode/settings.json

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"maven": {
"dependencies": ["software.amazon.smithy:smithy-aws-traits:1.25.0", "software.amazon.smithy:smithy-waiters:1.25.0"],
"dependencies": ["software.amazon.smithy:smithy-aws-traits:1.23.1"],
"repositories": [{ "url": "https://repo1.maven.org/maven2/" }]
}
}
2 changes: 1 addition & 1 deletion test-fixtures/suite2/smithy-build.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"maven": {
"dependencies": ["software.amazon.smithy:smithy-aws-traits:1.25.0"],
"dependencies": ["software.amazon.smithy:smithy-aws-traits:1.23.1"],
"repositories": [{ "url": "https://repo1.maven.org/maven2/" }]
}
}
2 changes: 1 addition & 1 deletion test-fixtures/suite3/smithy-build.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"maven": {
"dependencies": ["software.amazon.smithy:smithy-aws-traits:1.25.0"],
"dependencies": ["software.amazon.smithy:smithy-aws-traits:1.23.1"],
"repositories": [{ "url": "https://repo1.maven.org/maven2/" }]
}
}
10 changes: 4 additions & 6 deletions tests/suite1/extension.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,27 @@ import { getDocUri, getLangServerLogs, waitForServerStartup } from "./../helper"

suite("Extension tests", () => {
test("Should start extension and Language Server", async () => {
const smithyMainUri = getDocUri("suite1/smithy/main.smithy");
const smithyMainUri = getDocUri("suite1/main.smithy");
const doc = await vscode.workspace.openTextDocument(smithyMainUri);
const editor = await vscode.window.showTextDocument(doc);
const ext = vscode.extensions.getExtension("smithy.smithy-vscode-extension");
await waitForServerStartup();
const diagnostics = vscode.languages.getDiagnostics(smithyMainUri);

// Grab model file directly
const modelFile = await vscode.workspace.openTextDocument(getDocUri("suite1/smithy/main.smithy"));
const modelFile = await vscode.workspace.openTextDocument(getDocUri("suite1/main.smithy"));
const modelFileText = modelFile.getText();

assert.match(modelFileText, /namespace example.weather/);

// Grab Language Server logs
const logText = await getLangServerLogs("suite1/smithy");
const logText = await getLangServerLogs("suite1");

assert.notEqual(doc, undefined);
assert.notEqual(editor, undefined);
assert.equal(ext.isActive, true);
assert.match(logText, /Downloaded external jars.*smithy-aws-traits-1\.25\.0\.jar/);
assert.match(logText, /Downloaded external jars.*smithy-waiters-1\.25\.0\.jar/);
assert.match(logText, /Downloaded external jars.*smithy-aws-traits-1\.23\.1\.jar/);
assert.match(logText, /Discovered smithy files.*\/main.smithy]/);
assert.doesNotMatch(logText, /Unable to resolve trait/);
assert.equal(diagnostics.length, 0);
}).timeout(10000);

Expand Down

0 comments on commit 8987d63

Please sign in to comment.