-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: feat(ts): convert js src files to ts
- Loading branch information
Showing
133 changed files
with
8,626 additions
and
7,383 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 |
---|---|---|
@@ -1,10 +1,43 @@ | ||
root: true | ||
parser: '@typescript-eslint/parser' | ||
parserOptions: | ||
ecmaVersion: 2019 | ||
sourceType: script | ||
project: './tsconfig.json' | ||
sourceType: module | ||
env: | ||
node: true | ||
es6: true | ||
jest: true | ||
extends: eslint:recommended | ||
node: true | ||
es6: true | ||
jest: true | ||
mocha: true | ||
plugins: | ||
- 'import' | ||
extends: | ||
- 'eslint:recommended' | ||
- 'plugin:@typescript-eslint/recommended' | ||
- 'plugin:@typescript-eslint/recommended-requiring-type-checking' | ||
- 'plugin:prettier/recommended' | ||
- 'plugin:import/errors' | ||
- 'plugin:import/warnings' | ||
- 'plugin:import/typescript' | ||
ignorePatterns: | ||
- 'build/*' | ||
- 'tests/**/*.js' | ||
- 'examples/*' | ||
- 'bin/*' | ||
- '.yarn/*' | ||
- 'scripts/*' | ||
- 'jest.config.js' | ||
rules: | ||
no-unused-vars: off | ||
'no-console': 'warn' | ||
'no-duplicate-imports': 'error' | ||
'no-return-await': 'error' | ||
'no-unneeded-ternary': 'error' | ||
'no-unused-vars': [ 'off' ] | ||
'prefer-object-spread': 'error' | ||
'require-await': 'off' | ||
'@typescript-eslint/ban-ts-comment': 'warn' | ||
'@typescript-eslint/restrict-template-expressions': 'warn' | ||
'@typescript-eslint/unbound-method': 'warn' | ||
'@typescript-eslint/no-unsafe-argument': 'warn' | ||
'@typescript-eslint/explicit-function-return-type': 'error' | ||
'@typescript-eslint/no-unsafe-assignment': 'warn' | ||
'@typescript-eslint/no-unsafe-member-access': 'warn' |
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,17 @@ | ||
# .prettierrc | ||
arrowParens: always | ||
printWidth: 100 | ||
semi: false | ||
singleQuote: true | ||
tabWidth: 4 | ||
overrides: | ||
- files: | ||
- "*.yml" | ||
- "*.yaml" | ||
options: | ||
bracketSpacing: false | ||
tabWidth: 2 | ||
- files: "*.json" | ||
options: | ||
trailingComma: all | ||
tabWidth: 4 |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
'use strict' | ||
|
||
module.exports = () => ({ | ||
data: 'fixture loaded from javascript module' | ||
data: 'fixture loaded from javascript module', | ||
}) |
This file was deleted.
Oops, something went wrong.
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,4 @@ | ||
|
||
import { Given } from "@cucumber/cucumber" | ||
|
||
Given(/^(?:I )?define http mock from (.+)$/, function () {}) |
This file was deleted.
Oops, something went wrong.
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,11 @@ | ||
import { Given } from "@cucumber/cucumber" | ||
import nock from "nock" | ||
|
||
Given( | ||
/^I mock http call to forward request body for path (.+)$/, | ||
function (path) { | ||
nock("http://fake.io") | ||
.post(path) | ||
.reply(200, (uri, requestBody) => requestBody) | ||
} | ||
) |
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
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 |
---|---|---|
@@ -1,88 +1,110 @@ | ||
{ | ||
"name": "@ekino/veggies", | ||
"version": "1.1.0", | ||
"description": "Veggies is an awesome cucumberjs library for API/CLI testing. Great for testing APIs built upon Express, Koa, HAPI, Loopback and others. It's also the perfect companion for testing CLI applications built with commander, meow & Co.", | ||
"tags": [ | ||
"bdd", | ||
"cucumber", | ||
"gherkin", | ||
"testing", | ||
"api", | ||
"http", | ||
"cli" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/ekino/veggies.git" | ||
}, | ||
"main": "src/index.js", | ||
"bin": "./bin/veggies.js", | ||
"author": "plouc <https://github.com/plouc>", | ||
"maintainers": [ | ||
{ | ||
"name": "Raphaël Benitte" | ||
"name": "@ekino/veggies", | ||
"version": "1.1.0", | ||
"description": "Veggies is an awesome cucumberjs library for API/CLI testing. Great for testing APIs built upon Express, Koa, HAPI, Loopback and others. It's also the perfect companion for testing CLI applications built with commander, meow & Co.", | ||
"tags": [ | ||
"bdd", | ||
"cucumber", | ||
"gherkin", | ||
"testing", | ||
"api", | ||
"http", | ||
"cli" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/ekino/veggies.git" | ||
}, | ||
"main": "build/src/index.js", | ||
"types": "build/src/index.d.ts", | ||
"bin": "build/bin/veggies.js", | ||
"author": "plouc <https://github.com/plouc>", | ||
"maintainers": [ | ||
{ | ||
"name": "Raphaël Benitte" | ||
} | ||
], | ||
"license": "MIT", | ||
"engines": { | ||
"node": ">=12" | ||
}, | ||
"engineStrict": true, | ||
"dependencies": { | ||
"arg": "5.0.1", | ||
"chai": "4.3", | ||
"fs-extra": "10.0.0", | ||
"glob": "7.2.0", | ||
"jest-diff": "27.4.2", | ||
"js-yaml": "4.1.0", | ||
"lodash": "4.17.21", | ||
"moment-timezone": "0.5.34", | ||
"natural-compare": "1.4.0", | ||
"pretty-format": "27.4.2", | ||
"request": "2.88.2", | ||
"tough-cookie": "4.0.0" | ||
}, | ||
"devDependencies": { | ||
"@commitlint/config-conventional": "15.x", | ||
"@cucumber/cucumber": "7.x", | ||
"@types/babylon": "6.x", | ||
"@types/chai": "4.x", | ||
"@types/fs-extra": "9.x", | ||
"@types/glob": "7.x", | ||
"@types/jest": "27.x", | ||
"@types/js-yaml": "4.x", | ||
"@types/lodash": "4.x", | ||
"@types/moment-timezone": "0.5.x", | ||
"@types/mustache": "4.x", | ||
"@types/natural-compare": "1.x", | ||
"@types/node": "16.x", | ||
"@types/proxyquire": "^1.3.28", | ||
"@types/request": "2.x", | ||
"@types/sinon": "10.x", | ||
"@types/tough-cookie": "4.x", | ||
"@typescript-eslint/eslint-plugin": "5.x", | ||
"@typescript-eslint/parser": "5.x", | ||
"babylon": "6.x", | ||
"chalk": "4.x", | ||
"commitlint": "15.x", | ||
"conventional-changelog-cli": "2.x", | ||
"coveralls": "3.x", | ||
"eslint": "8.x", | ||
"eslint-config-prettier": "8.x", | ||
"eslint-plugin-import": "2.x", | ||
"eslint-plugin-prettier": "4.x", | ||
"gh-pages": "3.x", | ||
"husky": "7.0.4", | ||
"jest": "27.x", | ||
"jsdoc": "3.x", | ||
"lint-staged": "12.x", | ||
"minami": "1.x", | ||
"mustache": "4.x", | ||
"nock": "13.x", | ||
"prettier": "2.x", | ||
"proxyquire": "^2.1.3", | ||
"sinon": "12.x", | ||
"ts-jest": "27.x", | ||
"ts-node": "10.x", | ||
"typescript": "4.5.x" | ||
}, | ||
"peerDependencies": { | ||
"@cucumber/cucumber": ">=7.0.0" | ||
}, | ||
"scripts": { | ||
"build": "rm -rf build & tsc -d", | ||
"test": "jest --verbose --colors tests", | ||
"test-cover": "jest --verbose --colors --coverage", | ||
"test-cli": "veggies --require tests/cli/support tests/cli/features", | ||
"coverage": "cat ./coverage/lcov.info | coveralls", | ||
"fmt": "prettier --print-width 100 --tab-width=4 --single-quote --bracket-spacing --no-semi --color --write \"{src,tests,scripts}/**/*.js\"", | ||
"check-fmt": "prettier --print-width 100 --tab-width=4 --single-quote --bracket-spacing --no-semi --list-different \"{src,tests,scripts}/**/*.js\"", | ||
"lint": "eslint . --quiet", | ||
"lint-fix": "eslint --fix . --quiet", | ||
"readme": "ts-node -T -s scripts/generate_readme.ts", | ||
"check-readme": "ts-node -T -s scripts/generate_readme.ts --check", | ||
"doc": "jsdoc -c .jsdoc.json --verbose", | ||
"doc-pub": "yarn run readme && yarn run doc && gh-pages -d _doc", | ||
"examples": "veggies --require examples/support examples/features", | ||
"changelog": "conventional-changelog -p conventionalcommits -i CHANGELOG.md -s" | ||
} | ||
], | ||
"license": "MIT", | ||
"engines": { | ||
"node": ">=12" | ||
}, | ||
"engineStrict": true, | ||
"dependencies": { | ||
"arg": "5.0.1", | ||
"chai": "4.3", | ||
"fs-extra": "10.0.0", | ||
"glob": "7.2.0", | ||
"jest-diff": "27.4.2", | ||
"js-yaml": "4.1.0", | ||
"lodash": "4.17.21", | ||
"moment-timezone": "0.5.34", | ||
"natural-compare": "1.4.0", | ||
"pretty-format": "27.4.2", | ||
"request": "2.88.2", | ||
"tough-cookie": "4.0.0" | ||
}, | ||
"devDependencies": { | ||
"@commitlint/config-conventional": "15.x", | ||
"@cucumber/cucumber": "7.x", | ||
"@types/jest": "27.x", | ||
"@types/node": "16.x", | ||
"babylon": "6.x", | ||
"chalk": "4.x", | ||
"commitlint": "15.x", | ||
"conventional-changelog-cli": "2.x", | ||
"coveralls": "3.x", | ||
"eslint": "8.x", | ||
"gh-pages": "3.x", | ||
"husky": "^7.0.4", | ||
"jest": "27.x", | ||
"jsdoc": "3.x", | ||
"lint-staged": "12.x", | ||
"minami": "1.x", | ||
"mustache": "4.x", | ||
"nock": "13.x", | ||
"prettier": "2.x", | ||
"sinon": "12.x", | ||
"ts-jest": "27.x", | ||
"typescript": "4.5.x" | ||
}, | ||
"peerDependencies": { | ||
"@cucumber/cucumber": ">=7.0.0" | ||
}, | ||
"scripts": { | ||
"test": "jest --verbose --colors tests", | ||
"test-cover": "jest --verbose --colors --coverage", | ||
"test-cli": "veggies --require tests/cli/support tests/cli/features", | ||
"coverage": "cat ./coverage/lcov.info | coveralls", | ||
"fmt": "prettier --print-width 100 --tab-width=4 --single-quote --bracket-spacing --no-semi --color --write \"{src,tests,scripts}/**/*.js\"", | ||
"check-fmt": "prettier --print-width 100 --tab-width=4 --single-quote --bracket-spacing --no-semi --list-different \"{src,tests,scripts}/**/*.js\"", | ||
"lint": "eslint .", | ||
"lint-fix": "eslint --fix .", | ||
"readme": "node scripts/generate_readme", | ||
"check-readme": "node scripts/generate_readme --check", | ||
"doc": "jsdoc -c .jsdoc.json --verbose", | ||
"doc-pub": "yarn run readme && yarn run doc && gh-pages -d _doc", | ||
"examples": "veggies --require examples/support examples/features", | ||
"changelog": "conventional-changelog -p conventionalcommits -i CHANGELOG.md -s" | ||
} | ||
} |
Oops, something went wrong.