mirror of
https://github.com/movie-web/providers.git
synced 2025-09-13 13:03:25 +00:00
Add very basic integration tests
This commit is contained in:
@@ -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': [
|
||||||
|
3
.github/workflows/tests.yml
vendored
3
.github/workflows/tests.yml
vendored
@@ -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/",
|
||||||
|
3
tests/README.md
Normal file
3
tests/README.md
Normal file
@@ -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.
|
2
tests/cjs/index.js
Normal file
2
tests/cjs/index.js
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
require('../../lib/index.umd');
|
||||||
|
console.log('import successful!');
|
4
tests/cjs/package.json
Normal file
4
tests/cjs/package.json
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"main": "index.js",
|
||||||
|
"type": "commonjs"
|
||||||
|
}
|
2
tests/esm/index.mjs
Normal file
2
tests/esm/index.mjs
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
import '../../lib/index.mjs';
|
||||||
|
console.log('import successful!');
|
4
tests/esm/package.json
Normal file
4
tests/esm/package.json
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"main": "index.mjs",
|
||||||
|
"type": "module"
|
||||||
|
}
|
Reference in New Issue
Block a user