-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests scaffold, linting and GitHub workflow
- Loading branch information
Showing
7 changed files
with
1,984 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Reboot.dev Node.js Template | ||
|
||
on: [push] | ||
|
||
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Lint sources | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '18.x' | ||
cache: 'npm' | ||
- run: npm ci | ||
- run: npm run lint | ||
|
||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Run all tests | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '18.x' | ||
cache: 'npm' | ||
- run: npm ci | ||
- run: npm run test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { ExternalContext, Reboot } from "@reboot-dev/reboot"; | ||
import { describe, it, before, after } from "node:test"; | ||
import assert from "node:assert"; | ||
|
||
describe("Main Application", async () => { | ||
let context: ExternalContext; | ||
let rbt: Reboot; | ||
|
||
before(async () => { | ||
rbt = new Reboot(); | ||
await rbt.start(); | ||
await rbt.up([]); | ||
context = rbt.createExternalContext("test-runner"); | ||
}); | ||
|
||
after(async () => { | ||
await rbt.stop(); | ||
}); | ||
|
||
describe("Servicer", () => { | ||
it("does not throw", async () => { | ||
assert.ok(context); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// @ts-check | ||
|
||
import eslint from '@eslint/js'; | ||
import tseslint from 'typescript-eslint'; | ||
|
||
export default tseslint.config( | ||
eslint.configs.recommended, | ||
...tseslint.configs.recommended, | ||
); |
Oops, something went wrong.