mirror of
https://github.com/softprops/action-gh-release.git
synced 2024-09-11 20:27:22 +03:00
* bump version * address asset upload warning * refactor to new octokit api, work around release asset upload api * format upload url * unminify to debug * try alt constructor * utilize formatted upload url * authorize upload * pass token explicitly * address conflicting uploads * remove debugging artifacts
26 lines
855 B
TypeScript
26 lines
855 B
TypeScript
//import * as assert from "assert";
|
|
//const assert = require('assert');
|
|
import * as assert from "assert";
|
|
import { mimeOrDefault, asset } from "../src/github";
|
|
|
|
describe("github", () => {
|
|
describe("mimeOrDefault", () => {
|
|
it("returns a specific mime for common path", async () => {
|
|
assert.equal(mimeOrDefault("foo.tar.gz"), "application/gzip");
|
|
});
|
|
it("returns default mime for uncommon path", async () => {
|
|
assert.equal(mimeOrDefault("foo.uncommon"), "application/octet-stream");
|
|
});
|
|
});
|
|
|
|
describe("asset", () => {
|
|
it("derives asset info from a path", async () => {
|
|
const { name, mime, size, data } = asset("tests/data/foo/bar.txt");
|
|
assert.equal(name, "bar.txt");
|
|
assert.equal(mime, "text/plain");
|
|
assert.equal(size, 10);
|
|
assert.equal(data.toString(), "release me");
|
|
});
|
|
});
|
|
});
|