Skip to content

Commit cf11480

Browse files
added editor format on save
1 parent c4d90cd commit cf11480

12 files changed

Lines changed: 883 additions & 860 deletions

File tree

.vscode/settings.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
2-
"deno.enable": true,
3-
"deno.lint": true,
4-
"deno.unstable": true
5-
}
2+
"deno.enable": true,
3+
"deno.lint": true,
4+
"deno.unstable": true,
5+
"editor.formatOnSave": true,
6+
"editor.defaultFormatter": "denoland.vscode-deno"
7+
}

deno.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,23 @@
11
{
2+
"lint": {
3+
"include": ["src/"],
4+
"exclude": ["src/testing/", "src/**/*.test.ts", "src/*test.ts/"],
5+
"rules": {
6+
"tags": ["recommended"],
7+
"include": [],
8+
"exclude": ["no-unused-vars", "ban-untagged-todo"]
9+
}
10+
},
11+
"fmt": {
12+
"useTabs": true,
13+
"lineWidth": 80,
14+
"indentWidth": 4,
15+
"semiColons": false,
16+
"singleQuote": true,
17+
"proseWrap": "preserve",
18+
"include": ["src/"],
19+
"exclude": ["src/testdata/", "data/fixtures/**/*.ts"]
20+
},
221
"tasks": {
322
"test": "deno test --allow-net --allow-read --allow-write --allow-env --allow-run"
423
}

src/services/downloader.test.ts

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,49 @@
1-
import { assertExists } from "https://deno.land/std@0.206.0/assert/assert_exists.ts";
2-
import { Downloader } from "./downloader.ts";
3-
import { removeStackQLDownload } from "../../testing/utils.ts";
1+
import { assertExists } from 'https://deno.land/std@0.206.0/assert/assert_exists.ts'
2+
import { Downloader } from './downloader.ts'
3+
import { removeStackQLDownload } from '../../testing/utils.ts'
44
import {
5-
assertSpyCalls,
6-
spy,
7-
} from "https://deno.land/std@0.207.0/testing/mock.ts";
5+
assertSpyCalls,
6+
spy,
7+
} from 'https://deno.land/std@0.207.0/testing/mock.ts'
88

9-
Deno.test("Downloader setupStackQL and upgrade Test", async () => {
10-
// Arrange
11-
await removeStackQLDownload();
12-
const downloader = new Downloader();
13-
let binaryPath: string;
14-
const denoOpenSpy = spy(Deno, "open");
9+
Deno.test('Downloader setupStackQL and upgrade Test', async () => {
10+
// Arrange
11+
await removeStackQLDownload()
12+
const downloader = new Downloader()
13+
let binaryPath: string
14+
const denoOpenSpy = spy(Deno, 'open')
1515

16-
// Act
17-
const setupTest = async () => {
18-
try {
19-
binaryPath = await downloader.setupStackQL();
16+
// Act
17+
const setupTest = async () => {
18+
try {
19+
binaryPath = await downloader.setupStackQL()
2020

21-
// Assert
22-
assertExists(binaryPath);
23-
assertSpyCalls(denoOpenSpy, 1);
24-
// Check if the binary exists after setupStackQL is called
21+
// Assert
22+
assertExists(binaryPath)
23+
assertSpyCalls(denoOpenSpy, 1)
24+
// Check if the binary exists after setupStackQL is called
2525

26-
console.log(
27-
"Test passed: setupStackQL completed without errors and binary exists."
28-
);
29-
} catch (error) {
30-
console.error("Test failed:", error);
31-
throw error; // This will cause the test to fail
32-
}
33-
};
26+
console.log(
27+
'Test passed: setupStackQL completed without errors and binary exists.',
28+
)
29+
} catch (error) {
30+
console.error('Test failed:', error)
31+
throw error // This will cause the test to fail
32+
}
33+
}
3434

35-
const upgradeTest = async () => {
36-
try {
37-
binaryPath = await downloader.upgradeStackQL();
35+
const upgradeTest = async () => {
36+
try {
37+
binaryPath = await downloader.upgradeStackQL()
3838

39-
assertExists(binaryPath);
40-
assertSpyCalls(denoOpenSpy, 2);
41-
} catch (error) {
42-
console.error("Test failed:", error);
43-
throw error; // This will cause the test to fail
44-
}
45-
};
39+
assertExists(binaryPath)
40+
assertSpyCalls(denoOpenSpy, 2)
41+
} catch (error) {
42+
console.error('Test failed:', error)
43+
throw error // This will cause the test to fail
44+
}
45+
}
4646

47-
await setupTest();
48-
await upgradeTest();
49-
});
47+
await setupTest()
48+
await upgradeTest()
49+
})

0 commit comments

Comments
 (0)