-
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.
Initial version of Witcher API tester
- Loading branch information
0 parents
commit 4679a5a
Showing
46 changed files
with
14,427 additions
and
0 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,6 @@ | ||
{ | ||
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier"], | ||
"parser": "@typescript-eslint/parser", | ||
"plugins": ["@typescript-eslint"], | ||
"root": 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,36 @@ | ||
# TODO: Test | ||
name: Publish Package to npmjs | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: "18.x" | ||
registry-url: "https://registry.npmjs.org" | ||
|
||
- name: Git configuration | ||
run: | | ||
git config --global user.email "code@getjoystick.com" | ||
git config --global user.name "GitHub Actions" | ||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Run eslint and prettier check | ||
run: npm run lint | ||
|
||
- name: Build | ||
run: npm run build | ||
|
||
- name: Publish | ||
run: npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
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,37 @@ | ||
name: Verify build | ||
|
||
on: | ||
push: | ||
|
||
jobs: | ||
verification: | ||
name: "Verify build (lint + build + tests)" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
- name: Run CI | ||
run: npm ci | ||
- name: Run Lint | ||
run: npm run lint | ||
- name: Run Build | ||
run: npm run build | ||
|
||
- name: Shutdown pre-installed Ubuntu MySQL | ||
run: sudo service mysql stop | ||
- name: Run MySQL server for running test | ||
uses: mirromutth/mysql-action@v1.1 | ||
with: | ||
mysql version: "5.7" | ||
mysql database: "dbname" | ||
mysql user: "user" | ||
mysql password: "password" | ||
- name: Wait for MySQL | ||
run: | | ||
while ! mysqladmin ping --host=127.0.0.1 --password=password --user=user --silent; do | ||
sleep 1 | ||
done | ||
- name: Run Test | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
node_modules | ||
|
||
.DS_Store | ||
.idea | ||
|
||
joystick-* | ||
tests-json/secrets/**/* | ||
dist/ |
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,7 @@ | ||
{ | ||
"trailingComma": "all", | ||
"tabWidth": 2, | ||
"semi": true, | ||
"singleQuote": false, | ||
"printWidth": 120 | ||
} |
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,19 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Debug", | ||
"type": "node", | ||
"request": "launch", | ||
"args": ["src/index.mts"], | ||
"runtimeArgs": ["--loader", "ts-node/esm"], | ||
"console": "integratedTerminal", | ||
"cwd": "${workspaceRoot}", | ||
"protocol": "inspector", | ||
"internalConsoleOptions": "openOnSessionStart" | ||
} | ||
] | ||
} |
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,18 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
## [0.1.0] - 2023-08-14 | ||
|
||
### Added | ||
|
||
- Interactive mode to visually select configuration for the test | ||
- Non-interactive mode to run the application in CI environment | ||
- Joystick as a data-source for testing configurations and devs collaboration | ||
- Structure of configurations files | ||
- Dedicated files structure to store secrets needed for tests (e.g. database credentials) | ||
- Variables shared between test steps | ||
- Assertions based on responses and changes in the database |
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,14 @@ | ||
version: "3.3" | ||
services: | ||
db: | ||
image: mysql:5.7 | ||
restart: always | ||
environment: | ||
MYSQL_DATABASE: "dbname" | ||
MYSQL_USER: "user" | ||
MYSQL_PASSWORD: "password" | ||
MYSQL_ROOT_PASSWORD: "password" | ||
ports: | ||
- "3306:3306" | ||
expose: | ||
- "3306" |
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,19 @@ | ||
import type { JestConfigWithTsJest } from "ts-jest"; | ||
|
||
export default { | ||
testEnvironment: "node", | ||
preset: "ts-jest/presets/default-esm", // or other ESM presets | ||
extensionsToTreatAsEsm: [".ts", ".mts"], | ||
moduleFileExtensions: ["ts", "mts", "js", "json"], | ||
transform: { | ||
"^.+\\.mts$": [ | ||
"ts-jest", | ||
{ | ||
useESM: true, | ||
}, | ||
], | ||
}, | ||
moduleNameMapper: { | ||
"^(\\.{1,2}/.*)\\.m?js$": "$1", | ||
}, | ||
} as JestConfigWithTsJest; |
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,6 @@ | ||
import jestCommon from "./jest.common"; | ||
|
||
export default { | ||
...jestCommon, | ||
testRegex: "integration.(test|spec).mts", | ||
}; |
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,6 @@ | ||
import jestCommon from "./jest.common"; | ||
|
||
export default { | ||
...jestCommon, | ||
testRegex: "unit.(test|spec).mts", | ||
}; |
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,7 @@ | ||
{ | ||
"watch": ["src"], | ||
"ext": ".ts,.js,.mts,.mjs", | ||
"ignore": [], | ||
"exec": "node --inspect --loader ts-node/esm ./src/index.mts", | ||
"restartable": false | ||
} |
Oops, something went wrong.