Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
905444068f | ||
|
|
1526ced25e | ||
|
|
f66842bcf8 | ||
|
|
dcdf20756a | ||
|
|
6b34e9a272 |
@@ -4,7 +4,7 @@ author: "platane"
|
||||
|
||||
runs:
|
||||
using: docker
|
||||
image: docker://platane/snk@sha256:74d02183a9a4adb8e00d9f50e6eb5035a5b6ef02644d848363ef3301235ebd1d
|
||||
image: docker://platane/snk@sha256:e2cd3268901a65f1402bea9133b8d6ed4a34796ca92ead9686f5aa048f22487a
|
||||
|
||||
inputs:
|
||||
github_user_name:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "snk",
|
||||
"description": "Generates a snake game from a github user contributions grid",
|
||||
"version": "1.1.3",
|
||||
"version": "1.1.4",
|
||||
"private": true,
|
||||
"repository": "github:platane/snk",
|
||||
"devDependencies": {
|
||||
|
||||
@@ -47,7 +47,7 @@ describe("getGithubUserContribution", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("should match snapshot for year=2019", async () => {
|
||||
xit("should match snapshot for year=2019", async () => {
|
||||
expect(
|
||||
await getGithubUserContribution("platane", { year: 2019 })
|
||||
).toMatchSnapshot();
|
||||
|
||||
@@ -56,13 +56,17 @@ const parseUserPage = (content: string) => {
|
||||
|
||||
//
|
||||
// parse cells
|
||||
const rawCells = $(".js-calendar-graph rect[data-count]")
|
||||
const rawCells = $(".js-calendar-graph rect[data-level][data-date]")
|
||||
.toArray()
|
||||
.map((x) => {
|
||||
const level = +x.attribs["data-level"];
|
||||
const count = +x.attribs["data-count"];
|
||||
const date = x.attribs["data-date"];
|
||||
|
||||
const literalCount = $(x)
|
||||
.text()
|
||||
.match(/(No|\d+) contributions? on/)![1];
|
||||
const count = literalCount === "No" ? 0 : +literalCount;
|
||||
|
||||
const color = colorScheme[level];
|
||||
|
||||
if (!color) throw new Error("could not determine the color of the cell");
|
||||
|
||||
Reference in New Issue
Block a user