Skip to content

Commit d3d6c41

Browse files
add tests
1 parent d0eca7e commit d3d6c41

2 files changed

Lines changed: 21 additions & 2 deletions

File tree

extensions/ql-vscode/src/vscode-tests/no-workspace/remote-queries/export-results.test.ts

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@ import { Credentials } from '../../../authentication';
99
import { MarkdownFile } from '../../../remote-queries/remote-queries-markdown-generation';
1010
import * as actionsApiClient from '../../../remote-queries/gh-api/gh-actions-api-client';
1111
import { exportResultsToGist } from '../../../remote-queries/export-results';
12+
import { CUSTOM_CODEQL_PATH_SETTING, getRemoteControllerRepo, getRemoteRepositoryLists, setRemoteControllerRepo, setRemoteRepositoryLists } from '../../../config';
13+
import { allTestSettings } from '../../test-config';
1214

1315
const proxyquire = pq.noPreserveCache();
1416

15-
describe('export results', async function() {
17+
describe.only('export results', async function() {
1618
describe('exportResultsToGist', async function() {
1719
let sandbox: sinon.SinonSandbox;
1820
let mockCredentials: Credentials;
@@ -40,6 +42,24 @@ describe('export results', async function() {
4042
sandbox.restore();
4143
});
4244

45+
it('a', () => {
46+
expect(Object.values(allTestSettings).length).to.be.equal(21);
47+
});
48+
49+
it('b', () => {
50+
expect(CUSTOM_CODEQL_PATH_SETTING.getValue()).to.be.equal(process.env.CLI_PATH);
51+
});
52+
53+
it('c', async () => {
54+
expect(getRemoteControllerRepo()).to.be.undefined;
55+
await setRemoteRepositoryLists({ 'foo': ['bar'] });
56+
});
57+
58+
it('d', async () => {
59+
expect(getRemoteRepositoryLists()).to.be.undefined;
60+
await setRemoteControllerRepo('foo');
61+
});
62+
4363
it('should call the GitHub Actions API with the correct gist title', async function() {
4464
mockCreateGist = sinon.stub(actionsApiClient, 'createGist');
4565

extensions/ql-vscode/src/vscode-tests/test-config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import * as path from 'path';
22
import * as fs from 'fs-extra';
33
import { ConfigurationTarget } from 'vscode';
44
import { InspectionResult, Setting } from '../config';
5-
import { obj } from 'through2';
65

76
class TestSetting<T> {
87
private settingState: InspectionResult<T> | undefined;

0 commit comments

Comments
 (0)