New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
web-api: basic module system integration tests, removing unused bits, dependency updates #1724
Changes from all commits
982d4f6
65b543a
04bc08c
ed8b301
4781d80
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,7 +38,8 @@ | |
"build:clean": "shx rm -rf ./dist ./coverage ./.nyc_output", | ||
"lint": "eslint --ext .ts src", | ||
"mocha": "mocha --config .mocharc.json src/*.spec.js", | ||
"test": "npm run lint && npm run test:unit && npm run test:types", | ||
"test": "npm run lint && npm run test:unit && npm run test:types && npm run test:integration", | ||
"test:integration": "npm run build && node test/integration/commonjs-project/index.js && node test/integration/esm-project/index.mjs", | ||
"test:unit": "npm run build && nyc --reporter=text-summary npm run mocha", | ||
"test:types": "tsd", | ||
"ref-docs:model": "api-extractor run", | ||
|
@@ -52,37 +53,36 @@ | |
"eventemitter3": "^5.0.1", | ||
"form-data": "^4.0.0", | ||
"is-electron": "2.2.2", | ||
"is-stream": "^2.0.0", | ||
"p-queue": "^6.6.2", | ||
"p-retry": "^4.6.1", | ||
"is-stream": "^2", | ||
"p-queue": "^6", | ||
"p-retry": "^4", | ||
"retry": "^0.13.1" | ||
}, | ||
"devDependencies": { | ||
"@aoberoi/capture-console": "^1.1.0", | ||
"@microsoft/api-extractor": "^7.38.0", | ||
"@types/chai": "^4.3.5", | ||
"@types/mocha": "^10.0.1", | ||
"@types/sinon": "^10.0.20", | ||
"@typescript-eslint/eslint-plugin": "^6.4.1", | ||
"@typescript-eslint/parser": "^6.4.0", | ||
"busboy": "^1.6.0", | ||
"chai": "^4.3.8", | ||
"eslint": "^8.47.0", | ||
"eslint-config-airbnb-base": "^15.0.0", | ||
"eslint-config-airbnb-typescript": "^17.1.0", | ||
"eslint-plugin-import": "^2.28.1", | ||
"eslint-plugin-jsdoc": "^46.5.0", | ||
"eslint-plugin-node": "^11.1.0", | ||
"mocha": "^10.2.0", | ||
"nock": "^13.3.3", | ||
"nyc": "^15.1.0", | ||
"shelljs": "^0.8.3", | ||
"@microsoft/api-extractor": "^7", | ||
"@tsconfig/recommended": "^1", | ||
"@types/chai": "^4", | ||
"@types/mocha": "^10", | ||
"@types/sinon": "^17", | ||
"@typescript-eslint/eslint-plugin": "^6", | ||
"@typescript-eslint/parser": "^6", | ||
"busboy": "^1", | ||
"chai": "^4", | ||
"eslint": "^8", | ||
"eslint-config-airbnb-base": "^15", | ||
"eslint-config-airbnb-typescript": "^17", | ||
"eslint-plugin-import": "^2", | ||
"eslint-plugin-jsdoc": "^48", | ||
"eslint-plugin-node": "^11", | ||
"mocha": "^10", | ||
"nock": "^13", | ||
"nyc": "^15", | ||
"shx": "^0.3.2", | ||
"sinon": "^15.2.0", | ||
"sinon": "^17", | ||
"source-map-support": "^0.5.21", | ||
"ts-node": "^10.8.1", | ||
"tsd": "0.29.0", | ||
"typescript": "^4.1" | ||
"ts-node": "^10", | ||
"tsd": "^0.30.0", | ||
"typescript": "5.3.3" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒🔒🔒🔒🔒.3.3 👍 Happy to remove breaking builds from this! |
||
}, | ||
"tsd": { | ||
"directory": "test/types" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* eslint-disable */ | ||
const WebApi = require('../../../dist/index'); | ||
const client = new WebApi.WebClient('invalid-token'); | ||
const assert = require('assert'); | ||
client.auth.test().then((res) => { | ||
console.error('❌ Unexpected `auth.test` API success! Exiting CJS project integration test with non-zero exit code.'); | ||
process.exit(1); | ||
}).catch((e) => { | ||
assert(e.message.includes('invalid_auth'), '❌ Did not receive expected "invalid_auth" response from `auth.test` API, CJS project integration test failed.'); | ||
console.log('✅ CJS project integration test succeeded!'); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"name": "commonjs-project", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* eslint-disable */ | ||
import { WebClient } from '../../../dist/index.js'; | ||
import assert from 'assert'; | ||
const client = new WebClient('invalid-token'); | ||
try { | ||
const res = await client.auth.test(); | ||
console.error('❌ Unexpected auth.test success! Exiting ESM project integration test with non-zero exit code.'); | ||
process.exit(1); | ||
} catch (e) { | ||
assert(e.message.includes('invalid_auth'), '❌ Did not receive expected "invalid_auth" response from `auth.test` API, ESM project integration test failed.'); | ||
console.log('✅ ESM project integration test succeeded!'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"name": "esm-project", | ||
"type": "module", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "index.mjs", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,27 @@ | ||
{ | ||
"$schema": "https://json.schemastore.org/tsconfig", | ||
"compilerOptions": { | ||
"target": "es2017", | ||
"module": "commonjs", | ||
"declaration": true, | ||
"declarationMap": true, | ||
"sourceMap": true, | ||
"outDir": "dist", | ||
|
||
"strict": true, | ||
"noFallthroughCasesInSwitch": true, | ||
"noImplicitReturns": true, | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true, | ||
"noImplicitReturns": true, | ||
"noFallthroughCasesInSwitch": true, | ||
|
||
"moduleResolution": "node", | ||
"baseUrl": ".", | ||
"paths": { | ||
"*": ["./types/*"] | ||
}, | ||
"esModuleInterop" : true, | ||
|
||
// Not using this setting because its only used to require the package.json file, and that would change the | ||
// structure of the files in the dist directory because package.json is not located inside src. It would be nice | ||
// to use import instead of require(), but its not worth the tradeoff of restructuring the build (for now). | ||
// "resolveJsonModule": true, | ||
"outDir": "dist", | ||
"sourceMap": true, | ||
}, | ||
"extends": "@tsconfig/recommended/tsconfig.json", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🙌 🙌 |
||
"include": [ | ||
"src/**/*" | ||
], | ||
"exclude": [ | ||
"src/**/*.spec.js", | ||
"src/**/*.js" | ||
], | ||
"jsdoc": { | ||
"out": "support/jsdoc", | ||
"access": "public" | ||
}, | ||
"exclude": [ | ||
"src/**/*.js" | ||
], | ||
"ts-node": { | ||
"esm": true | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Farewell, deno-shims/buffer-shim.js 👋 😔