Add very basic integration tests
This commit is contained in:
parent
01d56a49d0
commit
3ca04d8361
|
@ -3,7 +3,7 @@ module.exports = {
|
||||||
browser: true,
|
browser: true,
|
||||||
},
|
},
|
||||||
extends: ['airbnb-base', 'plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended'],
|
extends: ['airbnb-base', 'plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended'],
|
||||||
ignorePatterns: ['lib/*', '/*.js', '/*.ts', '/**/*.test.ts', 'test/*'],
|
ignorePatterns: ['lib/*', 'tests/*', '/*.js', '/*.ts', '/**/*.test.ts', 'test/*'],
|
||||||
parser: '@typescript-eslint/parser',
|
parser: '@typescript-eslint/parser',
|
||||||
parserOptions: {
|
parserOptions: {
|
||||||
project: './tsconfig.json',
|
project: './tsconfig.json',
|
||||||
|
@ -33,7 +33,7 @@ module.exports = {
|
||||||
'no-eval': 'off',
|
'no-eval': 'off',
|
||||||
'no-await-in-loop': 'off',
|
'no-await-in-loop': 'off',
|
||||||
'no-nested-ternary': 'off',
|
'no-nested-ternary': 'off',
|
||||||
'no-param-reassign': ["error", { "props": false }],
|
'no-param-reassign': ['error', { props: false }],
|
||||||
'prefer-destructuring': 'off',
|
'prefer-destructuring': 'off',
|
||||||
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
|
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
|
||||||
'import/extensions': [
|
'import/extensions': [
|
||||||
|
|
|
@ -27,5 +27,8 @@ jobs:
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: npm run test
|
run: npm run test
|
||||||
|
|
||||||
|
- name: Run integration tests
|
||||||
|
run: npm run test:integration
|
||||||
|
|
||||||
- name: Run linting
|
- name: Run linting
|
||||||
run: npm run lint
|
run: npm run lint
|
||||||
|
|
|
@ -38,6 +38,7 @@
|
||||||
"test": "vitest run",
|
"test": "vitest run",
|
||||||
"test:dev": "ts-node ./src/dev-cli.ts",
|
"test:dev": "ts-node ./src/dev-cli.ts",
|
||||||
"test:watch": "vitest",
|
"test:watch": "vitest",
|
||||||
|
"test:integration": "node ./tests/cjs && node ./tests/esm",
|
||||||
"test:coverage": "vitest run --coverage",
|
"test:coverage": "vitest run --coverage",
|
||||||
"lint": "eslint --ext .ts,.js src/",
|
"lint": "eslint --ext .ts,.js src/",
|
||||||
"lint:fix": "eslint --fix --ext .ts,.js src/",
|
"lint:fix": "eslint --fix --ext .ts,.js src/",
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
# Integration test folder
|
||||||
|
|
||||||
|
This folder simply holds some import tests, to see if the library still works with all its dependencies.
|
|
@ -0,0 +1,2 @@
|
||||||
|
require('../../lib/index.umd');
|
||||||
|
console.log('import successful!');
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"main": "index.js",
|
||||||
|
"type": "commonjs"
|
||||||
|
}
|
|
@ -0,0 +1,2 @@
|
||||||
|
import '../../lib/index.mjs';
|
||||||
|
console.log('import successful!');
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"main": "index.mjs",
|
||||||
|
"type": "module"
|
||||||
|
}
|
Loading…
Reference in New Issue