Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding TypeScript Module Integration Test (#177)
- Loading branch information
1 parent
1de29e9
commit fc01945
Showing
13 changed files
with
105 additions
and
19 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 |
---|---|---|
|
@@ -2,4 +2,5 @@ | |
node_modules | ||
npm-debug.log | ||
yarn.lock | ||
package-lock.json | ||
package-lock.json | ||
*.tgz |
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 @@ | ||
package-lock=false |
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,7 +1,17 @@ | ||
language: node_js | ||
node_js: | ||
- "6" | ||
- "8" | ||
- "10" | ||
- "12" | ||
- "14" | ||
|
||
jobs: | ||
include: | ||
# note that unit tests are run on the Node.js versions specified above | ||
|
||
# packages koa-body and installs it in the integration project as a dependency | ||
- stage: TS integration test | ||
script: | | ||
npm pack | ||
cd test/ts-module-integration | ||
npm install | ||
npm run build |
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,2 +1,2 @@ | ||
--reporter spec | ||
--require should | ||
--require should |
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 @@ | ||
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,2 @@ | ||
# we want to rely on koa-body's dependencies declared in package.json, not a generated lock | ||
package-lock=false |
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,15 @@ | ||
import Koa from 'koa'; | ||
import koaBody from 'koa-body'; | ||
|
||
const app = new Koa(); | ||
app.use(koaBody()); | ||
|
||
/** | ||
* Koa-body 4.1.2 breaking changes | ||
*/ | ||
async function m(ctx: Koa.ParameterizedContext) { | ||
const { body } = ctx.request; | ||
console.log(JSON.stringify(body)); | ||
} | ||
|
||
app.use(m); |
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,21 @@ | ||
{ | ||
"name": "ts-koa-body-test", | ||
"private": true, | ||
"version": "0.0.0", | ||
"description": "koa-body TS integration test", | ||
"main": "dist/lib/index.js", | ||
"module": "dist/lib/index.js", | ||
"types": "dist/types/index.d.ts", | ||
"scripts": { | ||
"build": "tsc --module commonjs" | ||
}, | ||
"dependencies": { | ||
"@types/koa": "^2.11.3", | ||
"@types/node": "^11.15.10", | ||
"koa": "^2.12.0", | ||
"koa-body": "../../" | ||
}, | ||
"devDependencies": { | ||
"typescript": "^3.8.3" | ||
} | ||
} |
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,35 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "es6", | ||
"module": "es2015", | ||
"moduleResolution": "node", | ||
"declaration": true, | ||
"sourceMap": true, | ||
"strict": true, | ||
"esModuleInterop": true, | ||
"outDir": "dist/lib", | ||
"declarationDir": "dist/types", | ||
"emitDecoratorMetadata": true, | ||
"experimentalDecorators": true, | ||
"allowSyntheticDefaultImports": true, | ||
"plugins": [ | ||
{ | ||
"name": "tslint-language-service" | ||
} | ||
], | ||
"lib": [ | ||
"es2015", | ||
"es2016", | ||
"es2017" | ||
], | ||
"typeRoots": [ | ||
"node_modules/@types" | ||
] | ||
}, | ||
"include": [ | ||
"lib" | ||
], | ||
"exclude": [ | ||
"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