Skip to content

Commit

Permalink
chore: fix nightly tests (#97)
Browse files Browse the repository at this point in the history
* test(command): fix nightly test

* test(command): fix nightly test

* chore(ci): update lint test
  • Loading branch information
c4spar committed Oct 10, 2020
1 parent 32f01e0 commit e0093b7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/lint.yml
Expand Up @@ -3,15 +3,20 @@ name: Lint
on: [push, pull_request]

jobs:
build:

lint:
name: Lint source
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Setup repo
uses: actions/checkout@master
uses: actions/checkout@v2

- name: Setup Deno
uses: denolib/setup-deno@master
uses: denolib/setup-deno@v2
with:
deno-version: v1.x

- name: Setup shellcheck
run: >
Expand Down
10 changes: 6 additions & 4 deletions command/test/command/help_command_test.ts
Expand Up @@ -3,6 +3,8 @@ import { CompletionsCommand } from "../../completions/mod.ts";
import { HelpCommand } from "../../help/mod.ts";
import { Command } from "../../command.ts";

const isNightly: boolean = Deno.version.deno.match(/nightly/) !== null;

function command(defaultOptions?: boolean, hintOption?: boolean) {
const cmd = new Command()
.throwErrors()
Expand Down Expand Up @@ -64,7 +66,7 @@ function command(defaultOptions?: boolean, hintOption?: boolean) {

Deno.test({
name: "command: help command with line break (deno <= v1.4.0)",
ignore: gt(Deno.version.deno, "1.4.0"),
ignore: isNightly || gt(Deno.version.deno, "1.4.0"),
async fn() {
const output: string = command(true, false).getHelp();

Expand Down Expand Up @@ -107,7 +109,7 @@ Deno.test({
Deno.test({
name:
"command: help command with line break but without default options (deno <= v1.4.0)",
ignore: gt(Deno.version.deno, "1.4.0"),
ignore: isNightly || gt(Deno.version.deno, "1.4.0"),
async fn() {
const output: string = command(false, false).getHelp();

Expand Down Expand Up @@ -147,7 +149,7 @@ Deno.test({

Deno.test({
name: "command: help command with line break (deno >= v1.4.1)",
ignore: lt(Deno.version.deno, "1.4.1"),
ignore: !isNightly && lt(Deno.version.deno, "1.4.1"),
async fn() {
const output: string = command(true, true).getHelp();

Expand Down Expand Up @@ -192,7 +194,7 @@ Deno.test({
Deno.test({
name:
"command: help command with line break but without default options (deno >= v1.4.1)",
ignore: lt(Deno.version.deno, "1.4.1"),
ignore: !isNightly && lt(Deno.version.deno, "1.4.1"),
async fn() {
const output: string = command(false, true).getHelp();

Expand Down

0 comments on commit e0093b7

Please sign in to comment.