Archived
1
0
This repository has been archived on 2024-09-09. You can view files and clone it, but cannot push or open issues or pull requests.
code-server/test/integration/listExtensions.test.ts
Joe Previte 1296848afc
refactor: switch to codecov-uploader GitHub Action (#5303)
* refactor: switch to codecov-uploader GitHub Action

codecov deprecated their Node wrapper for uploading coverage reports.

This removes that and uses their new uploaded along with the v2 GitHub
Action they maintain.

* fix: update broken integration test
2022-06-28 10:04:35 -07:00

31 lines
1.3 KiB
TypeScript

import extract from "extract-zip"
import { rename } from "fs/promises"
import path from "path"
import { clean, tmpdir } from "../utils/helpers"
import { runCodeServerCommand } from "../utils/runCodeServerCommand"
describe("--list-extensions", () => {
const testName = "listExtensions"
const extName = `wesbos.theme-cobalt2`
const extVersion = "2.1.6"
const vsixFileName = `${extName}-${extVersion}.vsix`
let tempDir: string
let setupFlags: string[]
beforeEach(async () => {
await clean(testName)
tempDir = await tmpdir(testName)
setupFlags = ["--extensions-dir", tempDir]
const extensionFixture = path.resolve(`./test/integration/fixtures/${vsixFileName}`)
// Make folder because this is where we'll move the extension
const pathToUnpackedExtension = path.join(tempDir, `${extName}-${extVersion}`)
const tempPathToUnpackedExtension = path.join(tempDir, `${extName}-temp`)
await extract(extensionFixture, { dir: tempPathToUnpackedExtension })
await rename(path.join(tempPathToUnpackedExtension, "extension"), pathToUnpackedExtension)
})
it("should list installed extensions", async () => {
const { stdout } = await runCodeServerCommand([...setupFlags, "--list-extensions"])
expect(stdout).toMatch(extName)
}, 20000)
})