Skip to content

Commit

Permalink
Feature/responding to cl (#65)
Browse files Browse the repository at this point in the history
* Creation of yml files

* fix format

* fix yml file
  • Loading branch information
ta-Hirose authored Sep 6, 2022
1 parent e3d4108 commit 3b31ec9
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 98 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Automate the collection of coverage

on:
push:
branches:
- main
pull_request:
types:
- opened
- synchronize
- reopened

jobs:
test:
name: Collection of coverage

runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Deno runtime
uses: denoland/setup-deno@v1
with:
deno-version: v1.x

- name: Check format
run: deno fmt --check

- name: Do lint
run: deno lint

- name: Check type
run: deno check $(find . -regex '.*\.\(js\|ts\|jsx\|tsx\|mjs\|mjsx\)' -printf '%p ')

- name: Test and collect coverage
run: deno test -A --coverage=tests/coverage

- name: Create coverage report
run: deno coverage ./tests/coverage --lcov > tests/coverage.lcov

# - name: Upload to codecov
# uses: codecov/codecov-action@v3.1.0
# with:
# file: ./tests/coverage.lcov
# fail_ci_if_error: true
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -329,15 +329,14 @@ $ deno install --unstable --allow-read --allow-write --allow-run --allow-net dim

# Upgrade the dim version

You need to be able to run Deno in a local environment.
If you don't have an execution environment of Deno, please re-install.
You need to be able to run Deno in a local environment.\
If you don't have an execution environment of Deno, please re-install.\
[Install the dim from binary files](#install-the-dim-from-binary-files)

```
$ dim upgrade
```


# Contributers

<a href="https://github.com/c-3lab/dim/graphs/contributors">
Expand Down
7 changes: 1 addition & 6 deletions tests/libs/actions.init.test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import { assertEquals } from "https://deno.land/std@0.152.0/testing/asserts.ts";
import { Stub, stub } from "https://deno.land/std@0.152.0/testing/mock.ts";
import {
afterEach,
beforeEach,
describe,
it,
} from "https://deno.land/std@0.152.0/testing/bdd.ts";
import { afterEach, beforeEach, describe, it } from "https://deno.land/std@0.152.0/testing/bdd.ts";

import { InitAction } from "../../libs/actions.ts";
import { removeTemporaryFiles, temporaryDirectory } from "../helper.ts";
Expand Down
18 changes: 3 additions & 15 deletions tests/libs/actions.install.test.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,7 @@
import {
assert,
assertEquals,
} from "https://deno.land/std@0.152.0/testing/asserts.ts";
import {
assertSpyCall,
Stub,
stub,
} from "https://deno.land/std@0.152.0/testing/mock.ts";
import { assert, assertEquals } from "https://deno.land/std@0.152.0/testing/asserts.ts";
import { assertSpyCall, Stub, stub } from "https://deno.land/std@0.152.0/testing/mock.ts";
import { FakeTime } from "https://deno.land/std@0.152.0/testing/time.ts";
import {
afterEach,
beforeEach,
describe,
it,
} from "https://deno.land/std@0.152.0/testing/bdd.ts";
import { afterEach, beforeEach, describe, it } from "https://deno.land/std@0.152.0/testing/bdd.ts";
import { Colors, encoding } from "../../deps.ts";
import { InstallAction } from "../../libs/actions.ts";
import { DimJSON, DimLockJSON } from "../../libs/types.ts";
Expand Down
19 changes: 3 additions & 16 deletions tests/libs/actions.list.test.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@
import {
assertSpyCall,
Stub,
stub,
} from "https://deno.land/std@0.152.0/testing/mock.ts";
import {
afterEach,
beforeEach,
describe,
it,
} from "https://deno.land/std@0.152.0/testing/bdd.ts";
import { assertSpyCall, Stub, stub } from "https://deno.land/std@0.152.0/testing/mock.ts";
import { afterEach, beforeEach, describe, it } from "https://deno.land/std@0.152.0/testing/bdd.ts";

import { ListAction } from "../../libs/actions.ts";
import {
createEmptyDimJson,
removeTemporaryFiles,
temporaryDirectory,
} from "../helper.ts";
import { createEmptyDimJson, removeTemporaryFiles, temporaryDirectory } from "../helper.ts";
import { DimLockJSON } from "../../libs/types.ts";
import { DEFAULT_DIM_LOCK_FILE_PATH } from "../../libs/consts.ts";
import { Colors } from "../../deps.ts";
Expand Down
21 changes: 4 additions & 17 deletions tests/libs/actions.search.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,8 @@ import {
assertFalse,
assertStringIncludes,
} from "https://deno.land/std@0.152.0/testing/asserts.ts";
import {
assertSpyCall,
returnsNext,
spy,
Stub,
stub,
} from "https://deno.land/std@0.152.0/testing/mock.ts";
import {
afterEach,
beforeEach,
describe,
it,
} from "https://deno.land/std@0.152.0/testing/bdd.ts";
import { assertSpyCall, returnsNext, spy, Stub, stub } from "https://deno.land/std@0.152.0/testing/mock.ts";
import { afterEach, beforeEach, describe, it } from "https://deno.land/std@0.152.0/testing/bdd.ts";
import { FakeTime } from "https://deno.land/std@0.152.0/testing/time.ts";
import { SearchAction } from "../../libs/actions.ts";
import {
Expand Down Expand Up @@ -73,8 +62,7 @@ describe("SearchAction", () => {
{
searchParams: new URLSearchParams(
{
fq:
`xckan_title:*避難所* OR tags:*避難所* OR x_ckan_description:*避難所*`,
fq: `xckan_title:*避難所* OR tags:*避難所* OR x_ckan_description:*避難所*`,
rows: "10",
},
),
Expand Down Expand Up @@ -272,8 +260,7 @@ describe("SearchAction", () => {
{
searchParams: new URLSearchParams(
{
fq:
`xckan_title:(*避難所* AND *東京*) OR tags:(*避難所* AND *東京*) OR x_ckan_description:(*避難所* AND *東京*)`,
fq: `xckan_title:(*避難所* AND *東京*) OR tags:(*避難所* AND *東京*) OR x_ckan_description:(*避難所* AND *東京*)`,
rows: "10",
},
),
Expand Down
29 changes: 5 additions & 24 deletions tests/libs/actions.uninstall.test.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,11 @@
import {
assertEquals,
assertFalse,
} from "https://deno.land/std@0.152.0/testing/asserts.ts";
import {
assertSpyCall,
Stub,
stub,
} from "https://deno.land/std@0.152.0/testing/mock.ts";
import {
afterEach,
beforeEach,
describe,
it,
} from "https://deno.land/std@0.152.0/testing/bdd.ts";
import { assertEquals, assertFalse } from "https://deno.land/std@0.152.0/testing/asserts.ts";
import { assertSpyCall, Stub, stub } from "https://deno.land/std@0.152.0/testing/mock.ts";
import { afterEach, beforeEach, describe, it } from "https://deno.land/std@0.152.0/testing/bdd.ts";
import { Colors } from "../../deps.ts";
import { UninstallAction } from "../../libs/actions.ts";
import {
DEFAULT_DIM_FILE_PATH,
DEFAULT_DIM_LOCK_FILE_PATH,
} from "../../libs/consts.ts";
import { DEFAULT_DIM_FILE_PATH, DEFAULT_DIM_LOCK_FILE_PATH } from "../../libs/consts.ts";
import { DimJSON, DimLockJSON } from "../../libs/types.ts";
import {
fileExists,
removeTemporaryFiles,
temporaryDirectory,
} from "../helper.ts";
import { fileExists, removeTemporaryFiles, temporaryDirectory } from "../helper.ts";

describe("UninstallAction", () => {
let consoleLogStub: Stub;
Expand Down
20 changes: 3 additions & 17 deletions tests/libs/actions.update.test.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,11 @@
import { assertEquals } from "https://deno.land/std@0.152.0/testing/asserts.ts";
import {
assertSpyCall,
Stub,
stub,
} from "https://deno.land/std@0.152.0/testing/mock.ts";
import { assertSpyCall, Stub, stub } from "https://deno.land/std@0.152.0/testing/mock.ts";
import { FakeTime } from "https://deno.land/std@0.152.0/testing/time.ts";
import {
afterEach,
beforeEach,
describe,
it,
} from "https://deno.land/std@0.152.0/testing/bdd.ts";
import { afterEach, beforeEach, describe, it } from "https://deno.land/std@0.152.0/testing/bdd.ts";
import { Colors } from "../../deps.ts";
import { UpdateAction } from "../../libs/actions.ts";
import { DimJSON, DimLockJSON } from "../../libs/types.ts";
import {
createEmptyDimJson,
createKyGetStub,
removeTemporaryFiles,
temporaryDirectory,
} from "../helper.ts";
import { createEmptyDimJson, createKyGetStub, removeTemporaryFiles, temporaryDirectory } from "../helper.ts";

describe("UpdateAction", () => {
let consoleLogStub: Stub;
Expand Down

0 comments on commit 3b31ec9

Please sign in to comment.