Merge pull request #182 from ing-bank/chore/updateTestingConfigs
Update testing configs for better DX
This commit is contained in:
commit
7b787d6c8f
13 changed files with 384 additions and 341 deletions
|
|
@ -7,7 +7,7 @@ version: 2
|
|||
defaults: &defaults
|
||||
working_directory: ~/repo
|
||||
docker:
|
||||
- image: circleci/node:10.12.0-browsers
|
||||
- image: circleci/node:10.16.0-browsers
|
||||
|
||||
jobs:
|
||||
test:
|
||||
|
|
@ -29,8 +29,12 @@ jobs:
|
|||
# run lint
|
||||
- run: npm run lint
|
||||
|
||||
# run tests
|
||||
- run: npm run test:bs
|
||||
# run test locally first
|
||||
- run: npm run test
|
||||
|
||||
# run compatibility tests for multiple browser via browserstack
|
||||
# disabled until we can safely test multiple browsers
|
||||
# - run: npm run test:bs
|
||||
|
||||
- persist_to_workspace:
|
||||
root: ~/repo
|
||||
|
|
@ -44,7 +48,7 @@ jobs:
|
|||
at: ~/repo
|
||||
- add_ssh_keys:
|
||||
fingerprints:
|
||||
- "df:41:a0:89:d0:a1:30:7d:08:38:d6:65:73:61:a4:ec"
|
||||
- 'df:41:a0:89:d0:a1:30:7d:08:38:d6:65:73:61:a4:ec'
|
||||
- run:
|
||||
name: Authenticate with registry
|
||||
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ module.exports = {
|
|||
'no-console': 'off',
|
||||
'no-unused-expressions': 'off',
|
||||
'class-methods-use-this': 'off',
|
||||
'max-classes-per-file': 'off',
|
||||
},
|
||||
},
|
||||
],
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/* eslint-disable import/no-extraneous-dependencies */
|
||||
const createDefaultConfig = require('@open-wc/testing-karma/default-config');
|
||||
const { createDefaultConfig } = require('@open-wc/testing-karma');
|
||||
const merge = require('webpack-merge');
|
||||
|
||||
module.exports = config => {
|
||||
|
|
@ -17,6 +17,10 @@ module.exports = config => {
|
|||
},
|
||||
],
|
||||
|
||||
esm: {
|
||||
nodeResolve: true,
|
||||
},
|
||||
|
||||
// TODO: improve coverage
|
||||
coverageIstanbulReporter: {
|
||||
thresholds: {
|
||||
|
|
|
|||
19
package.json
19
package.json
|
|
@ -11,18 +11,15 @@
|
|||
"@open-wc/demoing-storybook": "^0.2.0",
|
||||
"@open-wc/eslint-config": "^1.0.0",
|
||||
"@open-wc/prettier-config": "^0.1.0",
|
||||
"@open-wc/testing": "^2.0.6",
|
||||
"@open-wc/testing-karma": "^2.0.3",
|
||||
"@open-wc/testing-karma-bs": "^1.1.3",
|
||||
"@open-wc/testing": "^2.3.2",
|
||||
"@open-wc/testing-karma": "^3.1.22",
|
||||
"@open-wc/testing-karma-bs": "^1.1.47",
|
||||
"@open-wc/testing-wallaby": "^0.1.12",
|
||||
"@webcomponents/webcomponentsjs": "^2.2.5",
|
||||
"babel-eslint": "^8.2.6",
|
||||
"babel-polyfill": "^6.26.0",
|
||||
"eclint": "^2.8.1",
|
||||
"eslint": "^5.14.1",
|
||||
"eslint-config-prettier": "^4.0.0",
|
||||
"eslint-plugin-html": "^5.0.3",
|
||||
"eslint-plugin-import": "^2.16.0",
|
||||
"eslint": "^6.1.0",
|
||||
"husky": "^1.0.0",
|
||||
"lerna": "3.4.3",
|
||||
"lint-staged": "^8.0.0",
|
||||
|
|
@ -38,12 +35,12 @@
|
|||
"storybook:build": "build-storybook -s ./assets",
|
||||
"test": "karma start --coverage",
|
||||
"test:watch": "karma start --auto-watch=true --single-run=false",
|
||||
"test:legacy": "karma start --legacy --coverage",
|
||||
"test:legacy:watch": "karma start --legacy --auto-watch=true --single-run=false",
|
||||
"test:compatibility": "karma start --compatibility all --coverage",
|
||||
"test:compatibility:watch": "karma start --compatibility all --auto-watch=true --single-run=false",
|
||||
"test:update-snapshots": "karma start --update-snapshots",
|
||||
"test:prune-snapshots": "karma start --prune-snapshots",
|
||||
"test:bs": "karma start karma.bs.config.js --coverage",
|
||||
"test:bs:legacy": "karma start --legacy karma.bs.config.js --coverage",
|
||||
"test:bs": "karma start karma.bs.config.js --coverage --compatibility all",
|
||||
"test:bs:compatibility": "karma start karma.bs.config.js --coverage --compatibility all",
|
||||
"lint": "run-p lint:*",
|
||||
"lint:eclint": "git ls-files | xargs eclint check",
|
||||
"lint:eslint": "eslint --ext .js,.html .",
|
||||
|
|
|
|||
|
|
@ -650,11 +650,9 @@ describe('<lion-fieldset>', () => {
|
|||
|
||||
it('has correct validation afterwards', async () => {
|
||||
const isCat = modelValue => ({ isCat: modelValue === 'cat' });
|
||||
const containsA = modelValues => {
|
||||
return {
|
||||
containsA: modelValues.color ? modelValues.color.indexOf('a') > -1 : false,
|
||||
};
|
||||
};
|
||||
const containsA = modelValues => ({
|
||||
containsA: modelValues.color ? modelValues.color.indexOf('a') > -1 : false,
|
||||
});
|
||||
|
||||
const el = await fixture(html`
|
||||
<${tag} .errorValidators=${[[containsA]]}>
|
||||
|
|
|
|||
1
packages/form-system/index.js
Normal file
1
packages/form-system/index.js
Normal file
|
|
@ -0,0 +1 @@
|
|||
// empty file
|
||||
|
|
@ -14,8 +14,9 @@ import '@lion/input-amount/lion-input-amount.js';
|
|||
import '@lion/input-date/lion-input-date.js';
|
||||
import '@lion/input-email/lion-input-email.js';
|
||||
|
||||
storiesOf('Forms|Form', module).add('Umbrella form', () => {
|
||||
return html`
|
||||
storiesOf('Forms|Form', module).add(
|
||||
'Umbrella form',
|
||||
() => html`
|
||||
<lion-form
|
||||
><form>
|
||||
<lion-input
|
||||
|
|
@ -103,5 +104,5 @@ storiesOf('Forms|Form', module).add('Umbrella form', () => {
|
|||
</div>
|
||||
</form></lion-form
|
||||
>
|
||||
`;
|
||||
});
|
||||
`,
|
||||
);
|
||||
|
|
|
|||
|
|
@ -19,9 +19,7 @@ export class LionInputDate extends FieldCustomMixin(LocalizeMixin(LionInput)) {
|
|||
|
||||
constructor() {
|
||||
super();
|
||||
this.parser = (value, options) => {
|
||||
return value === '' ? undefined : parseDate(value, options);
|
||||
};
|
||||
this.parser = (value, options) => (value === '' ? undefined : parseDate(value, options));
|
||||
this.formatter = formatDate;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
import { isValidIBAN } from '@bundled-es-modules/ibantools/ibantools.js';
|
||||
|
||||
export const isIBAN = value => {
|
||||
return isValidIBAN(value);
|
||||
};
|
||||
export const isIBAN = value => isValidIBAN(value);
|
||||
|
||||
export const isIBANValidator = () => [(...params) => ({ isIBAN: isIBAN(...params) })];
|
||||
|
||||
|
|
|
|||
|
|
@ -89,9 +89,7 @@ export class LionSelectRich extends FormRegistrarMixin(
|
|||
get slots() {
|
||||
return {
|
||||
...super.slots,
|
||||
invoker: () => {
|
||||
return document.createElement('lion-select-invoker');
|
||||
},
|
||||
invoker: () => document.createElement('lion-select-invoker'),
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -74,9 +74,7 @@ function rewriteLinksInMdContent(mdContent, filePath, cfg = rewriteLinksConfig)
|
|||
return newHref;
|
||||
};
|
||||
|
||||
const mdLink = (href, title, text) => {
|
||||
return `[${text}](${rewrite(href)}${title ? ` ${title}` : ''})`;
|
||||
};
|
||||
const mdLink = (href, title, text) => `[${text}](${rewrite(href)}${title ? ` ${title}` : ''})`;
|
||||
|
||||
const resultLinks = [];
|
||||
// /^!?\[(label)\]\(href(?:\s+(title))?\s*\)/
|
||||
|
|
|
|||
|
|
@ -3,13 +3,9 @@ const wallabyWebpack = require('wallaby-webpack'); // eslint-disable-line import
|
|||
// filter packages, e.g. 'core' / '{radio,radio-button}' / '{form,input*}'
|
||||
const packagePattern = '*';
|
||||
|
||||
const replaceAll = (str, oldValue, newValue) => {
|
||||
return str.split(oldValue).join(newValue);
|
||||
};
|
||||
const replaceAll = (str, oldValue, newValue) => str.split(oldValue).join(newValue);
|
||||
|
||||
const countOccurences = (str, subbstr) => {
|
||||
return str.split(subbstr).length - 1;
|
||||
};
|
||||
const countOccurences = (str, subbstr) => str.split(subbstr).length - 1;
|
||||
|
||||
const makeLionImportsRelative = file => {
|
||||
// example:
|
||||
|
|
|
|||
Loading…
Reference in a new issue