mirror of
https://github.com/jlengrand/open-wc.git
synced 2026-03-10 08:31:19 +00:00
fix: use chai instead of @bundled-es-modules/chai
This commit is contained in:
13
__snapshots__/Plugin: semantic-dom-diff.md
Normal file
13
__snapshots__/Plugin: semantic-dom-diff.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# `Plugin: semantic-dom-diff`
|
||||
|
||||
#### `can compare against a snapshot`
|
||||
|
||||
```html
|
||||
<div>
|
||||
<h1>
|
||||
Hey
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
```
|
||||
|
||||
@@ -45,7 +45,7 @@ module.exports = config => {
|
||||
babelModernExclude: [
|
||||
'**/node_modules/sinon/**/*',
|
||||
'**/node_modules/mocha/**/*',
|
||||
'**/node_modules/@bundled-es-modules/chai/**/*',
|
||||
'**/node_modules/chai/**/*',
|
||||
'**/node_modules/sinon/chai/**/*',
|
||||
],
|
||||
customBabelConfig: !coverage
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { expect } from '@bundled-es-modules/chai';
|
||||
import { stub } from 'sinon';
|
||||
import { expect } from './setup.js';
|
||||
import { add } from '../src/utils.js';
|
||||
|
||||
describe('add()', () => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { expect } from '@bundled-es-modules/chai';
|
||||
import { expect } from './setup.js';
|
||||
import { multiply } from '../src/utils.js';
|
||||
|
||||
describe('multiply()', () => {
|
||||
|
||||
4
packages/karma-esm/demo/basic/test/setup.js
Normal file
4
packages/karma-esm/demo/basic/test/setup.js
Normal file
@@ -0,0 +1,4 @@
|
||||
import 'chai/chai.js';
|
||||
|
||||
// @ts-ignore
|
||||
export const { expect, assert, should } = window.chai;
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"imports": {
|
||||
"lodash-es": "/base/node_modules/lodash-es/lodash.js",
|
||||
"@bundled-es-modules/chai": "/base/node_modules/@bundled-es-modules/chai/index.js"
|
||||
"chai": "/base/node_modules/chai/index.js"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { expect } from '@bundled-es-modules/chai';
|
||||
import { expect } from './setup.js';
|
||||
import { add } from '../src/utils.js';
|
||||
|
||||
console.log(import.meta.url);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { expect } from '@bundled-es-modules/chai';
|
||||
import { expect } from './setup.js';
|
||||
import { multiply } from '../src/utils.js';
|
||||
|
||||
describe('multiply()', () => {
|
||||
|
||||
4
packages/karma-esm/demo/import-map/test/setup.js
Normal file
4
packages/karma-esm/demo/import-map/test/setup.js
Normal file
@@ -0,0 +1,4 @@
|
||||
import 'chai/chai.js';
|
||||
|
||||
// @ts-ignore
|
||||
export const { expect, assert, should } = window.chai;
|
||||
@@ -48,7 +48,7 @@ module.exports = config => {
|
||||
babelModernExclude: [
|
||||
'**/node_modules/sinon/**/*',
|
||||
'**/node_modules/mocha/**/*',
|
||||
'**/node_modules/@bundled-es-modules/chai/**/*',
|
||||
'**/node_modules/chai/**/*',
|
||||
'**/node_modules/sinon/chai/**/*',
|
||||
],
|
||||
fileExtensions: ['.ts'],
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { expect } from '@bundled-es-modules/chai';
|
||||
import { expect } from './setup.js';
|
||||
import { add } from '../src/utils';
|
||||
|
||||
describe('add()', () => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { expect } from '@bundled-es-modules/chai';
|
||||
import { expect } from './setup.js';
|
||||
import { multiply } from '../src/utils';
|
||||
|
||||
describe('multiply()', () => {
|
||||
|
||||
4
packages/karma-esm/demo/typescript/test/setup.js
Normal file
4
packages/karma-esm/demo/typescript/test/setup.js
Normal file
@@ -0,0 +1,4 @@
|
||||
import 'chai/chai.js';
|
||||
|
||||
// @ts-ignore
|
||||
export const { expect, assert, should } = window.chai;
|
||||
@@ -38,8 +38,8 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/preset-typescript": "^7.3.3",
|
||||
"@bundled-es-modules/chai": "^4.2.1",
|
||||
"@types/lodash-es": "^4.17.3",
|
||||
"chai": "^4.2.0",
|
||||
"karma": "^4.1.0",
|
||||
"karma-browserstack-launcher": "^1.5.1",
|
||||
"karma-coverage-istanbul-reporter": "^2.0.5",
|
||||
|
||||
@@ -21,10 +21,10 @@ While `semantic-dom-diff` can be used standalone (see below), it most commonly u
|
||||
|
||||
> If you are using `@open-wc/testing` this is already done for you.
|
||||
```javascript
|
||||
import { chai } from '@bundled-es-modules/chai';
|
||||
import 'chai/chai.js';
|
||||
import { chaiDomDiff } from '@open-wc/semantic-dom-diff';
|
||||
|
||||
chai.use(chaiDomDiff);
|
||||
window.chai.use(chaiDomDiff);
|
||||
```
|
||||
</details>
|
||||
|
||||
@@ -177,7 +177,7 @@ it('renders correctly', async () => {
|
||||
Hey
|
||||
</div>
|
||||
`);
|
||||
|
||||
|
||||
expect(el).dom.to.equal('<div>Hey</div>', {
|
||||
ignoreAttributes: ['my-random-attribute']
|
||||
});
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
"prepublishOnly": "../../scripts/insert-header.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@bundled-es-modules/chai": "^4.2.0",
|
||||
"@open-wc/testing-helpers": "^1.1.7",
|
||||
"chai": "^4.2.0",
|
||||
"mocha": "^5.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* istanbul ignore next */
|
||||
// do manual setup and not use testing to not have circle dependencies
|
||||
import { chai } from '@bundled-es-modules/chai';
|
||||
import 'chai/chai.js';
|
||||
import { cachedWrappers } from '@open-wc/testing-helpers/index-no-side-effects.js';
|
||||
import { chaiDomDiff } from '../chai-dom-diff.js';
|
||||
|
||||
@@ -17,4 +17,8 @@ if (afterEach) {
|
||||
}
|
||||
|
||||
// register-plugins
|
||||
chai.use(chaiDomDiff);
|
||||
// @ts-ignore
|
||||
window.chai.use(chaiDomDiff);
|
||||
|
||||
// @ts-ignore
|
||||
export const { expect, assert, should } = window.chai;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { assert, expect } from '@bundled-es-modules/chai';
|
||||
import './bdd-setup.js';
|
||||
import { assert, expect } from './bdd-setup.js';
|
||||
|
||||
customElements.define(
|
||||
'snapshotted-element',
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { assert, expect } from '@bundled-es-modules/chai';
|
||||
import './bdd-setup.js';
|
||||
import { fixture, defineCE } from '@open-wc/testing-helpers';
|
||||
import { assert, expect } from './bdd-setup.js';
|
||||
|
||||
describe('dom', () => {
|
||||
it('can compare dom nodes', async () => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* eslint-disable no-useless-concat */
|
||||
import { expect } from '@bundled-es-modules/chai';
|
||||
import { expect } from './bdd-setup.js';
|
||||
import { getDiffableHTML } from '../index.js';
|
||||
|
||||
describe('getDiffableHTML()', () => {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { expect } from '@bundled-es-modules/chai';
|
||||
import { fixture, defineCE } from '@open-wc/testing-helpers';
|
||||
import '../bdd-setup.js';
|
||||
import { expect } from '../bdd-setup.js';
|
||||
import { getOuterHtml, getCleanedShadowDom } from '../../src/utils.js';
|
||||
|
||||
describe('getOuterHtml', () => {
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
"lit-html": "^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@bundled-es-modules/chai": "^4.2.0",
|
||||
"chai": "^4.2.0",
|
||||
"lit-html": "^1.0.0",
|
||||
"mocha": "^5.0.0",
|
||||
"sinon": "^7.4.1",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { expect } from '@bundled-es-modules/chai';
|
||||
import { expect } from './setup.js';
|
||||
import { elementUpdated } from '../src/elementUpdated.js';
|
||||
import { nextFrame } from '../src/helpers.js';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// @ts-ignore
|
||||
import sinon from 'sinon';
|
||||
// @ts-ignore
|
||||
import { expect } from '@bundled-es-modules/chai';
|
||||
import { expect } from './setup.js';
|
||||
import { cachedWrappers } from '../src/fixtureWrapper.js';
|
||||
import { defineCE } from '../src/helpers.js';
|
||||
import { fixture, fixtureSync } from '../src/fixture.js';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { expect } from '@bundled-es-modules/chai';
|
||||
import { expect } from './setup.js';
|
||||
import { defineCE, oneEvent, triggerFocusFor, triggerBlurFor, fixture } from '../index.js';
|
||||
|
||||
describe('Helpers', () => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { expect } from '@bundled-es-modules/chai';
|
||||
import { expect } from './setup.js';
|
||||
import { html, litFixture, unsafeStatic } from '../index.js';
|
||||
|
||||
/**
|
||||
|
||||
4
packages/testing-helpers/test/setup.js
Normal file
4
packages/testing-helpers/test/setup.js
Normal file
@@ -0,0 +1,4 @@
|
||||
import 'chai/chai.js';
|
||||
|
||||
// @ts-ignore
|
||||
export const { expect, assert, should } = window.chai;
|
||||
@@ -1,4 +1,4 @@
|
||||
import { expect } from '@bundled-es-modules/chai';
|
||||
import { expect } from './setup.js';
|
||||
import { stringFixture, stringFixtureSync } from '../src/stringFixture.js';
|
||||
import { litFixture, litFixtureSync } from '../src/litFixture.js';
|
||||
import { defineCE, nextFrame } from '../src/helpers.js';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { expect } from '@bundled-es-modules/chai';
|
||||
import { expect } from './setup.js';
|
||||
import { foo } from '../src/example.js';
|
||||
|
||||
describe('a', () => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { expect } from '@bundled-es-modules/chai';
|
||||
import { expect } from './setup.js';
|
||||
import { foo } from '../src/example.js';
|
||||
|
||||
describe('b', () => {
|
||||
|
||||
4
packages/testing-karma/demo/test/setup.js
Normal file
4
packages/testing-karma/demo/test/setup.js
Normal file
@@ -0,0 +1,4 @@
|
||||
import 'chai/chai.js';
|
||||
|
||||
// @ts-ignore
|
||||
export const { expect, assert, should } = window.chai;
|
||||
@@ -43,7 +43,7 @@
|
||||
"mocha": "^6.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@bundled-es-modules/chai": "^4.2.1",
|
||||
"chai": "^4.2.0",
|
||||
"karma-browserstack-launcher": "^1.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ module.exports = config => ({
|
||||
babelModernExclude: [
|
||||
'**/node_modules/sinon/**/*',
|
||||
'**/node_modules/mocha/**/*',
|
||||
'**/node_modules/@bundled-es-modules/chai/**/*',
|
||||
'**/node_modules/chai/**/*',
|
||||
'**/node_modules/sinon/chai/**/*',
|
||||
],
|
||||
polyfills: {
|
||||
|
||||
47
yarn.lock
47
yarn.lock
@@ -835,11 +835,6 @@
|
||||
resolved "https://registry.yarnpkg.com/@blakeembrey/deque/-/deque-1.0.5.tgz#f4fa17fc5ee18317ec01a763d355782c7b395eaf"
|
||||
integrity sha512-6xnwtvp9DY1EINIKdTfvfeAtCYw4OqBZJhtiqkT3ivjnEfa25VQ3TsKvaFfKm8MyGIEfE95qLe+bNEt3nB0Ylg==
|
||||
|
||||
"@bundled-es-modules/chai@^4.2.0", "@bundled-es-modules/chai@^4.2.1":
|
||||
version "4.2.1"
|
||||
resolved "https://registry.yarnpkg.com/@bundled-es-modules/chai/-/chai-4.2.1.tgz#124e9cc71584cb576c90b3e4e455abf525bbd3aa"
|
||||
integrity sha512-8tZO0prhIK8viNBAIo29lSXDJtTs/FrLwfNKsZiD0LzlTSGq6Ld2u7Bh73pUP2DvxMFqNbEWsRoUifOIvjDH8w==
|
||||
|
||||
"@commitlint/cli@7.2.1":
|
||||
version "7.2.1"
|
||||
resolved "https://registry.yarnpkg.com/@commitlint/cli/-/cli-7.2.1.tgz#dbb9eeb1f5015a129bb0801fbc1115eb1dcd513b"
|
||||
@@ -1992,16 +1987,16 @@
|
||||
"@types/chai" "^4.1.7"
|
||||
|
||||
"@open-wc/testing-karma-bs@file:./packages/testing-karma-bs":
|
||||
version "1.1.42"
|
||||
version "1.1.43"
|
||||
dependencies:
|
||||
"@open-wc/testing-karma" "^3.1.17"
|
||||
"@open-wc/testing-karma" "^3.1.18"
|
||||
"@types/node" "^11.13.0"
|
||||
karma-browserstack-launcher "^1.0.0"
|
||||
|
||||
"@open-wc/testing-karma@file:./packages/testing-karma":
|
||||
version "3.1.17"
|
||||
version "3.1.18"
|
||||
dependencies:
|
||||
"@open-wc/karma-esm" "^2.3.1"
|
||||
"@open-wc/karma-esm" "^2.3.2"
|
||||
axe-core "^3.3.1"
|
||||
istanbul-instrumenter-loader "^3.0.0"
|
||||
karma "^4.0.0"
|
||||
@@ -2479,7 +2474,14 @@
|
||||
resolved "https://registry.yarnpkg.com/@types/caseless/-/caseless-0.12.2.tgz#f65d3d6389e01eeb458bd54dc8f52b95a9463bc8"
|
||||
integrity sha512-6ckxMjBBD8URvjB6J3NcnuAn5Pkl7t3TizAg+xdlzzQGSPSmBcXf8KoIH0ua/i+tio+ZRUHEXp0HEmvaR4kt0w==
|
||||
|
||||
"@types/chai@^4.1.7":
|
||||
"@types/chai-dom@^0.0.8":
|
||||
version "0.0.8"
|
||||
resolved "https://registry.yarnpkg.com/@types/chai-dom/-/chai-dom-0.0.8.tgz#832b68d78390c80030e64d8fd4990e514484e91d"
|
||||
integrity sha512-F5vAuz2hp7VY+0UmkFLgTwyeHDddIw1c/JbAQZp2lgpZOd3ujlHFijWO4sHdo7sun9HrzwnSJlZfINdKrUwI+w==
|
||||
dependencies:
|
||||
"@types/chai" "*"
|
||||
|
||||
"@types/chai@*", "@types/chai@^4.1.7":
|
||||
version "4.2.0"
|
||||
resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.2.0.tgz#2478260021408dec32c123a7cad3414beb811a07"
|
||||
integrity sha512-zw8UvoBEImn392tLjxoavuonblX/4Yb9ha4KBU10FirCfwgzhKO0dvyJSF9ByxV1xK1r2AgnAi/tvQaLgxQqxA==
|
||||
@@ -2708,6 +2710,19 @@
|
||||
"@types/express-serve-static-core" "*"
|
||||
"@types/mime" "*"
|
||||
|
||||
"@types/sinon-chai@^3.2.3":
|
||||
version "3.2.3"
|
||||
resolved "https://registry.yarnpkg.com/@types/sinon-chai/-/sinon-chai-3.2.3.tgz#afe392303dda95cc8069685d1e537ff434fa506e"
|
||||
integrity sha512-TOUFS6vqS0PVL1I8NGVSNcFaNJtFoyZPXZ5zur+qlhDfOmQECZZM4H4kKgca6O8L+QceX/ymODZASfUfn+y4yQ==
|
||||
dependencies:
|
||||
"@types/chai" "*"
|
||||
"@types/sinon" "*"
|
||||
|
||||
"@types/sinon@*":
|
||||
version "7.0.13"
|
||||
resolved "https://registry.yarnpkg.com/@types/sinon/-/sinon-7.0.13.tgz#ca039c23a9e27ebea53e0901ef928ea2a1a6d313"
|
||||
integrity sha512-d7c/C/+H/knZ3L8/cxhicHUiTDxdgap0b/aNJfsmLwFu/iOP17mdgbQsbHA3SJmrzsjD0l3UEE5SN4xxuz5ung==
|
||||
|
||||
"@types/storybook__addon-actions@^3.4.1":
|
||||
version "3.4.3"
|
||||
resolved "https://registry.yarnpkg.com/@types/storybook__addon-actions/-/storybook__addon-actions-3.4.3.tgz#bb0c3fd066e1f495d3f2b724487e2b99194b3f1a"
|
||||
@@ -5139,6 +5154,11 @@ caseless@~0.12.0:
|
||||
resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc"
|
||||
integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=
|
||||
|
||||
chai-dom@^1.8.1:
|
||||
version "1.8.1"
|
||||
resolved "https://registry.yarnpkg.com/chai-dom/-/chai-dom-1.8.1.tgz#ce7978ac93d623314742aeb6ada86c9e4d8736de"
|
||||
integrity sha512-ysWinPU3fc+Bp+xMn/u2/PQyk65jnnCZl0alWupUuFFMGaG+KxrUnsoYOgjMDhSKPkm3WqE/5RTnOowIb7asMg==
|
||||
|
||||
chai@^4.2.0:
|
||||
version "4.2.0"
|
||||
resolved "https://registry.yarnpkg.com/chai/-/chai-4.2.0.tgz#760aa72cf20e3795e84b12877ce0e83737aa29e5"
|
||||
@@ -14481,7 +14501,12 @@ simple-swizzle@^0.2.2:
|
||||
dependencies:
|
||||
is-arrayish "^0.3.1"
|
||||
|
||||
sinon@^7.2.7, sinon@^7.3.2:
|
||||
sinon-chai@^3.3.0:
|
||||
version "3.3.0"
|
||||
resolved "https://registry.yarnpkg.com/sinon-chai/-/sinon-chai-3.3.0.tgz#8084ff99451064910fbe2c2cb8ab540c00b740ea"
|
||||
integrity sha512-r2JhDY7gbbmh5z3Q62pNbrjxZdOAjpsqW/8yxAZRSqLZqowmfGZPGUZPFf3UX36NLis0cv8VEM5IJh9HgkSOAA==
|
||||
|
||||
sinon@^7.4.1:
|
||||
version "7.4.1"
|
||||
resolved "https://registry.yarnpkg.com/sinon/-/sinon-7.4.1.tgz#bcd0c63953893e87fa0cc502f52489c32a83d4d9"
|
||||
integrity sha512-7s9buHGHN/jqoy/v4bJgmt0m1XEkCEd/tqdHXumpBp0JSujaT4Ng84JU5wDdK4E85ZMq78NuDe0I3NAqXY8TFg==
|
||||
|
||||
Reference in New Issue
Block a user