Add biome and initial format rules

This commit is contained in:
Nick Cipollo
2025-02-17 16:15:54 -05:00
parent 33bf18d283
commit 17b559883e
37 changed files with 3110 additions and 975 deletions

View File

@@ -1,40 +1,40 @@
import {Artifact} from "../src/Artifact";
import { Artifact } from "../src/Artifact"
const contentLength = 42
const fakeReadStream = {}
jest.mock('fs', () => {
jest.mock("fs", () => {
return {
createReadStream: () => fakeReadStream,
statSync: () => {
return {size: contentLength}
}
};
return { size: contentLength }
},
}
})
describe("Artifact", () => {
it('defaults contentType to raw', () => {
const artifact = new Artifact('')
expect(artifact.contentType).toBe('raw')
it("defaults contentType to raw", () => {
const artifact = new Artifact("")
expect(artifact.contentType).toBe("raw")
})
it('generates name from path', () => {
const artifact = new Artifact('some/artifact')
expect(artifact.name).toBe('artifact')
it("generates name from path", () => {
const artifact = new Artifact("some/artifact")
expect(artifact.name).toBe("artifact")
})
it('provides contentLength', () => {
const artifact = new Artifact('some/artifact')
it("provides contentLength", () => {
const artifact = new Artifact("some/artifact")
expect(artifact.contentLength).toBe(contentLength)
})
it('provides path', () => {
const artifact = new Artifact('some/artifact')
expect(artifact.path).toBe('some/artifact')
it("provides path", () => {
const artifact = new Artifact("some/artifact")
expect(artifact.path).toBe("some/artifact")
})
it('reads artifact', () => {
const artifact = new Artifact('some/artifact')
it("reads artifact", () => {
const artifact = new Artifact("some/artifact")
expect(artifact.readFile()).toBe(fakeReadStream)
})
})
})