Add types for package.json via @schemastore/package

This commit is contained in:
Henry Mercer 2023-01-20 12:03:17 +00:00
parent 1b508953b4
commit be8f7b01a2
27 changed files with 380 additions and 56 deletions

View file

@ -7,9 +7,6 @@ import { getApiClient } from "./api-client";
import { setupTests } from "./testing-utils";
import * as util from "./util";
// eslint-disable-next-line import/no-commonjs
const pkg = require("../package.json");
setupTests(test);
let pluginStub: sinon.SinonStub;
@ -19,7 +16,7 @@ test.beforeEach(() => {
pluginStub = sinon.stub(githubUtils.GitHub, "plugin");
githubStub = sinon.stub();
pluginStub.returns(githubStub);
util.initializeEnvironment(pkg.version as string);
util.initializeEnvironment(actionsUtil.getActionVersion());
});
test("getApiClient", async (t) => {
@ -39,7 +36,7 @@ test("getApiClient", async (t) => {
auth: "token xyz",
baseUrl: "http://api.github.localhost",
log: sinon.match.any,
userAgent: `CodeQL-Action/${pkg.version}`,
userAgent: `CodeQL-Action/${actionsUtil.getActionVersion()}`,
})
);
});