Skip to content

Commit

Permalink
CI: add Node.js 14 (#1246)
Browse files Browse the repository at this point in the history
* CI: add Node.js 14

* fix(operator): コードを修正

* fix(object): fix code

* fix

* chore: format

* chore: fix code
  • Loading branch information
azu authored Aug 29, 2020
1 parent 8aaf25b commit 8c4923a
Show file tree
Hide file tree
Showing 6 changed files with 103 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [12.x]
node-version: [12.x,]
os: [macOS-10.14, windows-latest, ubuntu-18.04]
name: "Build on Node.js: ${{ matrix.node-version }} OS: ${{ matrix.os }}"
steps:
Expand All @@ -30,7 +30,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x, 10.x]
node-version: [14.x, 12.x, 10.x]
name: "Test on Node.js ${{ matrix.node-version }}"
steps:
- uses: actions/checkout@v2
Expand Down
92 changes: 88 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,5 +119,7 @@
"wait-on": "^5.0.1",
"workbox-cli": "^3.6.3"
},
"dependencies": {}
"dependencies": {
"semver": "^7.3.2"
}
}
6 changes: 3 additions & 3 deletions source/basic/object/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -541,10 +541,10 @@ printWidgetTitle({
window: {
title: "Book Viewer"
}
}); // => "ウィジェットのタイトルはBook Viewerです"
}); // "ウィジェットのタイトルはBook Viewerです" と出力される
printWidgetTitle({
// タイトルが定義されてない空のオブジェクト
}); // => "ウィジェットのタイトルは未定義です"
}); // "ウィジェットのタイトルは未定義です" と出力される
```
また、Optional chaining演算子(`?.`)はブラケット記法(`[]`)と組み合わせることもできます。
Expand All @@ -555,7 +555,7 @@ printWidgetTitle({
```js
const languages = {
ja: {
hello: "こんにちは!"
hello: "こんにちは"
},
en: {
hello: "Hello!"
Expand Down
4 changes: 2 additions & 2 deletions source/basic/operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -924,12 +924,12 @@ Nullish coalescing演算子(`??`)は、左辺の値が**nulish**であるなら
```js
// 左辺がnullishであるため、右辺の値の評価結果を返す
console.log(null ?? "右辺の値"); // => "右辺の値"
console.log(undefiend ?? "右辺の値"); // => "右辺の値"
console.log(undefined ?? "右辺の値"); // => "右辺の値"
// 左辺がnullishではないため、右辺の値の評価結果を返す
console.log(true ?? "右辺の値"); // => true
console.log(false ?? "右辺の値"); // => false
console.log(0 ?? "右辺の値"); // => 0
console.log("文字列" ?? "右辺の値"); // => "左辺の値"
console.log("文字列" ?? "右辺の値"); // => "文字列"
```
Nullish coalescing演算子(`??`)とOR演算子(`||`)は、値のデフォルト値を指定する場合によく利用されています。
Expand Down
9 changes: 5 additions & 4 deletions test/markdown-doc-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,21 @@
"use strict";
import { test } from "@power-doctest/tester";
import { parse } from "@power-doctest/markdown";
import { toTestCode } from "./lib/testing-code";

const globby = require("globby");
const fs = require("fs");
const path = require("path");

import { toTestCode } from "./lib/testing-code";
const semver = require("semver");
const sourceDir = path.join(__dirname, "..", "source");


/**
* 指定したECMAScriptバージョンをmetaにもつコードは実行環境によってはサポートされてないので無視する
* .travis.ymlのサポートしているNode.jsバージョンに合わせる
* 最新版のNodeでは無視しない
* @type {string[]}
*/
const AllowECMAScriptVersions = ["2017", "2018", "2019", "2020"];
const AllowECMAScriptVersions = semver.cmp(process.version, ">=", "14.0.0") ? [] : ["2017", "2018", "2019", "2020"];
/**
* Markdownファイルの CodeBlock に対してdoctestを行う
* CodeBlockは必ず実行できるとは限らないので、
Expand Down

0 comments on commit 8c4923a

Please sign in to comment.