Skip to content

Commit

Permalink
code cleanup, add unit tests, hook up eslint and prettier (#100)
Browse files Browse the repository at this point in the history
* cleanup logic and hook up eslint and prettier

* core.addPath is called in updatecliVersion

* convert to module and use unicorn

* format

* tool-cache has sensible default for arch

* move core.addPath to updatecliDownload

* syntax

* syntax and prefer linux first in conditions

* dist

* fully testable

* fix lint

* cleanup test code

* fix import

* run tests

* make method testable when throwing exception

* dist

* check exitcode for run

* fix exit code test

* add updatecli target
  • Loading branch information
jetersen authored Jul 22, 2022
1 parent 4257603 commit 0458da2
Show file tree
Hide file tree
Showing 17 changed files with 1,173 additions and 364 deletions.
40 changes: 24 additions & 16 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
{
"env": {
"commonjs": true,
"es6": true,
"jest": true,
"node": true
},
"extends": "eslint:recommended",
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaVersion": 2018
},
"rules": {
}
"env": {
"commonjs": true,
"es6": true,
"jest": true,
"node": true
},
"ignorePatterns": [
"**/node_modules/",
"coverage/**"
],
"extends": [
"eslint:recommended",
"plugin:prettier/recommended",
"plugin:unicorn/recommended"
],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaVersion": 2022,
"sourceType": "module"
},
"rules": {}
}
2 changes: 2 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ jobs:

- run: npm ci

- run: npm test

e2e:
name: Test Updatecli Github Action
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,6 @@ typings/

# next.js build output
.next

CACHE/
TEMP/
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
dist/
lib/
node_modules/
coverage/
2 changes: 1 addition & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"useTabs": false,
"semi": false,
"singleQuote": true,
"trailingComma": "none",
"trailingComma": "es5",
"bracketSpacing": false,
"arrowParens": "avoid"
}
Loading

0 comments on commit 0458da2

Please sign in to comment.