mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2024-11-22 09:36:43 +03:00
chore(deps): update jest monorepo (major) (#791)
* chore(deps): update jest monorepo * Changes for jest 27 * Update types as well Co-authored-by: Renovate Bot <bot@renovateapp.com> Co-authored-by: Nathan Bierema <nbierema@gmail.com>
This commit is contained in:
parent
0101471ffb
commit
5cee92d1ef
|
@ -1,4 +1,5 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
setupFilesAfterEnv: ['<rootDir>/test/setup.js'],
|
setupFilesAfterEnv: ['<rootDir>/test/setup.js'],
|
||||||
testPathIgnorePatterns: ['<rootDir>/examples'],
|
testPathIgnorePatterns: ['<rootDir>/examples'],
|
||||||
|
testEnvironment: 'jsdom',
|
||||||
};
|
};
|
||||||
|
|
|
@ -10,10 +10,12 @@ const actionsPattern =
|
||||||
/^@@INIT(.|\n)+@@reduxReactRouter\/routerDidChange(.|\n)+@@reduxReactRouter\/initRoutes(.|\n)+$/;
|
/^@@INIT(.|\n)+@@reduxReactRouter\/routerDidChange(.|\n)+@@reduxReactRouter\/initRoutes(.|\n)+$/;
|
||||||
|
|
||||||
describe('Chrome extension', function () {
|
describe('Chrome extension', function () {
|
||||||
|
let driver;
|
||||||
|
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
chromedriver.start();
|
chromedriver.start();
|
||||||
await delay(2000);
|
await delay(2000);
|
||||||
this.driver = new webdriver.Builder()
|
driver = new webdriver.Builder()
|
||||||
.usingServer(`http://localhost:${port}`)
|
.usingServer(`http://localhost:${port}`)
|
||||||
.withCapabilities({
|
.withCapabilities({
|
||||||
chromeOptions: {
|
chromeOptions: {
|
||||||
|
@ -23,31 +25,32 @@ describe('Chrome extension', function () {
|
||||||
.forBrowser('chrome')
|
.forBrowser('chrome')
|
||||||
.build();
|
.build();
|
||||||
});
|
});
|
||||||
|
|
||||||
afterAll(async () => {
|
afterAll(async () => {
|
||||||
await this.driver.quit();
|
await driver.quit();
|
||||||
chromedriver.stop();
|
chromedriver.stop();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should open extension's window", async () => {
|
it("should open extension's window", async () => {
|
||||||
await this.driver.get(`chrome-extension://${extensionId}/window.html#left`);
|
await driver.get(`chrome-extension://${extensionId}/window.html#left`);
|
||||||
const url = await this.driver.getCurrentUrl();
|
const url = await driver.getCurrentUrl();
|
||||||
expect(url).toBe(`chrome-extension://${extensionId}/window.html#left`);
|
expect(url).toBe(`chrome-extension://${extensionId}/window.html#left`);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should match document title', async () => {
|
it('should match document title', async () => {
|
||||||
const title = await this.driver.getTitle();
|
const title = await driver.getTitle();
|
||||||
expect(title).toBe('Redux DevTools');
|
expect(title).toBe('Redux DevTools');
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should contain inspector monitor's component", async () => {
|
it("should contain inspector monitor's component", async () => {
|
||||||
const val = await this.driver
|
const val = await driver
|
||||||
.findElement(webdriver.By.xpath('//div[contains(@class, "inspector-")]'))
|
.findElement(webdriver.By.xpath('//div[contains(@class, "inspector-")]'))
|
||||||
.getText();
|
.getText();
|
||||||
expect(val).toBeDefined();
|
expect(val).toBeDefined();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should contain an empty actions list', async () => {
|
it('should contain an empty actions list', async () => {
|
||||||
const val = await this.driver
|
const val = await driver
|
||||||
.findElement(
|
.findElement(
|
||||||
webdriver.By.xpath('//div[contains(@class, "actionListRows-")]')
|
webdriver.By.xpath('//div[contains(@class, "actionListRows-")]')
|
||||||
)
|
)
|
||||||
|
@ -56,24 +59,24 @@ describe('Chrome extension', function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
Object.keys(switchMonitorTests).forEach((description) =>
|
Object.keys(switchMonitorTests).forEach((description) =>
|
||||||
it(description, switchMonitorTests[description].bind(this))
|
it(description, () => switchMonitorTests[description](driver))
|
||||||
);
|
);
|
||||||
|
|
||||||
it('should get actions list', async () => {
|
it('should get actions list', async () => {
|
||||||
const url = 'http://zalmoxisus.github.io/examples/router/';
|
const url = 'http://zalmoxisus.github.io/examples/router/';
|
||||||
await this.driver.executeScript(`window.open('${url}')`);
|
await driver.executeScript(`window.open('${url}')`);
|
||||||
await delay(2000);
|
await delay(2000);
|
||||||
|
|
||||||
const tabs = await this.driver.getAllWindowHandles();
|
const tabs = await driver.getAllWindowHandles();
|
||||||
|
|
||||||
await this.driver.switchTo().window(tabs[1]);
|
await driver.switchTo().window(tabs[1]);
|
||||||
expect(await this.driver.getCurrentUrl()).toMatch(url);
|
expect(await driver.getCurrentUrl()).toMatch(url);
|
||||||
await this.driver.manage().timeouts().pageLoadTimeout(5000);
|
await driver.manage().timeouts().pageLoadTimeout(5000);
|
||||||
|
|
||||||
await this.driver.switchTo().window(tabs[0]);
|
await driver.switchTo().window(tabs[0]);
|
||||||
|
|
||||||
const result = await this.driver.wait(
|
const result = await driver.wait(
|
||||||
this.driver
|
driver
|
||||||
.findElement(
|
.findElement(
|
||||||
webdriver.By.xpath('//div[contains(@class, "actionListRows-")]')
|
webdriver.By.xpath('//div[contains(@class, "actionListRows-")]')
|
||||||
)
|
)
|
||||||
|
|
|
@ -9,10 +9,12 @@ const devPanelPath =
|
||||||
'chrome-extension://lmhkpmbekcpmknklioeibfkpmmfibljd/window.html';
|
'chrome-extension://lmhkpmbekcpmknklioeibfkpmmfibljd/window.html';
|
||||||
|
|
||||||
describe('DevTools panel for Electron', function () {
|
describe('DevTools panel for Electron', function () {
|
||||||
|
let driver;
|
||||||
|
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
chromedriver.start();
|
chromedriver.start();
|
||||||
await delay(1000);
|
await delay(1000);
|
||||||
this.driver = new webdriver.Builder()
|
driver = new webdriver.Builder()
|
||||||
.usingServer(`http://localhost:${port}`)
|
.usingServer(`http://localhost:${port}`)
|
||||||
.withCapabilities({
|
.withCapabilities({
|
||||||
chromeOptions: {
|
chromeOptions: {
|
||||||
|
@ -22,33 +24,33 @@ describe('DevTools panel for Electron', function () {
|
||||||
})
|
})
|
||||||
.forBrowser('electron')
|
.forBrowser('electron')
|
||||||
.build();
|
.build();
|
||||||
await this.driver.manage().timeouts().setScriptTimeout(10000);
|
await driver.manage().timeouts().setScriptTimeout(10000);
|
||||||
});
|
});
|
||||||
|
|
||||||
afterAll(async () => {
|
afterAll(async () => {
|
||||||
await this.driver.quit();
|
await driver.quit();
|
||||||
chromedriver.stop();
|
chromedriver.stop();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should open Redux DevTools tab', async () => {
|
it('should open Redux DevTools tab', async () => {
|
||||||
if (!(await this.driver.getCurrentUrl()).startsWith('devtools')) {
|
if (!(await driver.getCurrentUrl()).startsWith('devtools')) {
|
||||||
const originalWindow = await this.driver.getWindowHandle();
|
const originalWindow = await driver.getWindowHandle();
|
||||||
const windows = await this.driver.getAllWindowHandles();
|
const windows = await driver.getAllWindowHandles();
|
||||||
for (const window of windows) {
|
for (const window of windows) {
|
||||||
if (window === originalWindow) continue;
|
if (window === originalWindow) continue;
|
||||||
await this.driver.switchTo().window(window);
|
await driver.switchTo().window(window);
|
||||||
if ((await this.driver.getCurrentUrl()).startsWith('devtools')) {
|
if ((await driver.getCurrentUrl()).startsWith('devtools')) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
expect(await this.driver.getCurrentUrl()).toMatch(
|
expect(await driver.getCurrentUrl()).toMatch(
|
||||||
/devtools:\/\/devtools\/bundled\/devtools_app.html/
|
/devtools:\/\/devtools\/bundled\/devtools_app.html/
|
||||||
);
|
);
|
||||||
|
|
||||||
await this.driver.manage().timeouts().pageLoadTimeout(5000);
|
await driver.manage().timeouts().pageLoadTimeout(5000);
|
||||||
|
|
||||||
const id = await this.driver.executeAsyncScript(function (callback) {
|
const id = await driver.executeAsyncScript(function (callback) {
|
||||||
let attempts = 5;
|
let attempts = 5;
|
||||||
function showReduxPanel() {
|
function showReduxPanel() {
|
||||||
if (attempts === 0) {
|
if (attempts === 0) {
|
||||||
|
@ -71,17 +73,17 @@ describe('DevTools panel for Electron', function () {
|
||||||
});
|
});
|
||||||
expect(id).toBe('chrome-extension://lmhkpmbekcpmknklioeibfkpmmfibljdRedux');
|
expect(id).toBe('chrome-extension://lmhkpmbekcpmknklioeibfkpmmfibljdRedux');
|
||||||
|
|
||||||
const className = await this.driver
|
const className = await driver
|
||||||
.findElement(webdriver.By.className(id))
|
.findElement(webdriver.By.className(id))
|
||||||
.getAttribute('class');
|
.getAttribute('class');
|
||||||
expect(className).not.toMatch(/hidden/); // not hidden
|
expect(className).not.toMatch(/hidden/); // not hidden
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should have Redux DevTools UI on current tab', async () => {
|
it('should have Redux DevTools UI on current tab', async () => {
|
||||||
await this.driver
|
await driver
|
||||||
.switchTo()
|
.switchTo()
|
||||||
.frame(
|
.frame(
|
||||||
this.driver.findElement(
|
driver.findElement(
|
||||||
webdriver.By.xpath(`//iframe[@src='${devPanelPath}']`)
|
webdriver.By.xpath(`//iframe[@src='${devPanelPath}']`)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
@ -89,7 +91,7 @@ describe('DevTools panel for Electron', function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should contain INIT action', async () => {
|
it('should contain INIT action', async () => {
|
||||||
const element = await this.driver.wait(
|
const element = await driver.wait(
|
||||||
webdriver.until.elementLocated(
|
webdriver.until.elementLocated(
|
||||||
webdriver.By.xpath('//div[contains(@class, "actionListRows-")]')
|
webdriver.By.xpath('//div[contains(@class, "actionListRows-")]')
|
||||||
),
|
),
|
||||||
|
@ -101,23 +103,23 @@ describe('DevTools panel for Electron', function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should contain Inspector monitor's component", async () => {
|
it("should contain Inspector monitor's component", async () => {
|
||||||
const val = await this.driver
|
const val = await driver
|
||||||
.findElement(webdriver.By.xpath('//div[contains(@class, "inspector-")]'))
|
.findElement(webdriver.By.xpath('//div[contains(@class, "inspector-")]'))
|
||||||
.getText();
|
.getText();
|
||||||
expect(val).toBeDefined();
|
expect(val).toBeDefined();
|
||||||
});
|
});
|
||||||
|
|
||||||
Object.keys(switchMonitorTests).forEach((description) =>
|
Object.keys(switchMonitorTests).forEach((description) =>
|
||||||
it(description, switchMonitorTests[description].bind(this))
|
it(description, () => switchMonitorTests[description](driver))
|
||||||
);
|
);
|
||||||
|
|
||||||
/* it('should be no logs in console of main window', async () => {
|
/* it('should be no logs in console of main window', async () => {
|
||||||
const handles = await this.driver.getAllWindowHandles();
|
const handles = await driver.getAllWindowHandles();
|
||||||
await this.driver.switchTo().window(handles[1]); // Change to main window
|
await driver.switchTo().window(handles[1]); // Change to main window
|
||||||
|
|
||||||
expect(await this.driver.getTitle()).toBe('Electron Test');
|
expect(await driver.getTitle()).toBe('Electron Test');
|
||||||
|
|
||||||
const logs = await this.driver.manage().logs().get(webdriver.logging.Type.BROWSER);
|
const logs = await driver.manage().logs().get(webdriver.logging.Type.BROWSER);
|
||||||
expect(logs).toEqual([]);
|
expect(logs).toEqual([]);
|
||||||
});
|
});
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -4,16 +4,16 @@ export const delay = (time) =>
|
||||||
new Promise((resolve) => setTimeout(resolve, time));
|
new Promise((resolve) => setTimeout(resolve, time));
|
||||||
|
|
||||||
export const switchMonitorTests = {
|
export const switchMonitorTests = {
|
||||||
'should switch to Log Monitor': async function () {
|
'should switch to Log Monitor': async function (driver) {
|
||||||
await this.driver
|
await driver
|
||||||
.findElement(webdriver.By.xpath('//button[text()="Inspector"]'))
|
.findElement(webdriver.By.xpath('//button[text()="Inspector"]'))
|
||||||
.click();
|
.click();
|
||||||
await delay(500); // Wait till menu is fully opened
|
await delay(500); // Wait till menu is fully opened
|
||||||
await this.driver
|
await driver
|
||||||
.findElement(webdriver.By.xpath('//button[text()="Log monitor"]'))
|
.findElement(webdriver.By.xpath('//button[text()="Log monitor"]'))
|
||||||
.click();
|
.click();
|
||||||
await delay(500);
|
await delay(500);
|
||||||
await this.driver.findElement(
|
await driver.findElement(
|
||||||
webdriver.By.xpath(
|
webdriver.By.xpath(
|
||||||
'//div[div[button[text()="Reset"]] and .//div[button[text()="Revert"]]]'
|
'//div[div[button[text()="Reset"]] and .//div[button[text()="Revert"]]]'
|
||||||
)
|
)
|
||||||
|
@ -21,27 +21,27 @@ export const switchMonitorTests = {
|
||||||
await delay(500);
|
await delay(500);
|
||||||
},
|
},
|
||||||
|
|
||||||
'should switch to Chart Monitor': async function () {
|
'should switch to Chart Monitor': async function (driver) {
|
||||||
await this.driver
|
await driver
|
||||||
.findElement(webdriver.By.xpath('//button[text()="Log monitor"]'))
|
.findElement(webdriver.By.xpath('//button[text()="Log monitor"]'))
|
||||||
.click();
|
.click();
|
||||||
await delay(500); // Wait till menu is fully opened
|
await delay(500); // Wait till menu is fully opened
|
||||||
await this.driver
|
await driver
|
||||||
.findElement(webdriver.By.xpath('//button[text()="Chart"]'))
|
.findElement(webdriver.By.xpath('//button[text()="Chart"]'))
|
||||||
.click();
|
.click();
|
||||||
await delay(500);
|
await delay(500);
|
||||||
await this.driver.findElement(
|
await driver.findElement(
|
||||||
webdriver.By.xpath('//*[@class="nodeText" and text()="state"]')
|
webdriver.By.xpath('//*[@class="nodeText" and text()="state"]')
|
||||||
);
|
);
|
||||||
await delay(500); // Wait till menu is closed
|
await delay(500); // Wait till menu is closed
|
||||||
},
|
},
|
||||||
|
|
||||||
'should switch back to Inspector Monitor': async function () {
|
'should switch back to Inspector Monitor': async function (driver) {
|
||||||
await this.driver
|
await driver
|
||||||
.findElement(webdriver.By.xpath('//button[text()="Chart"]'))
|
.findElement(webdriver.By.xpath('//button[text()="Chart"]'))
|
||||||
.click();
|
.click();
|
||||||
await delay(1000); // Wait till menu is fully opened
|
await delay(1000); // Wait till menu is fully opened
|
||||||
await this.driver
|
await driver
|
||||||
.findElement(webdriver.By.xpath('//button[text()="Inspector"]'))
|
.findElement(webdriver.By.xpath('//button[text()="Inspector"]'))
|
||||||
.click();
|
.click();
|
||||||
await delay(1500); // Wait till menu is closed
|
await delay(1500); // Wait till menu is closed
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
"@babel/preset-env": "^7.15.0",
|
"@babel/preset-env": "^7.15.0",
|
||||||
"@babel/preset-react": "^7.14.5",
|
"@babel/preset-react": "^7.14.5",
|
||||||
"@babel/preset-typescript": "^7.15.0",
|
"@babel/preset-typescript": "^7.15.0",
|
||||||
"@types/jest": "^26.0.24",
|
"@types/jest": "^27.0.1",
|
||||||
"@types/node": "^14.17.12",
|
"@types/node": "^14.17.12",
|
||||||
"@types/webpack": "^4.41.30",
|
"@types/webpack": "^4.41.30",
|
||||||
"@types/webpack-dev-server": "^3.11.6",
|
"@types/webpack-dev-server": "^3.11.6",
|
||||||
|
@ -30,7 +30,7 @@
|
||||||
"fork-ts-checker-webpack-plugin": "^6.3.2",
|
"fork-ts-checker-webpack-plugin": "^6.3.2",
|
||||||
"html-loader": "^1.3.2",
|
"html-loader": "^1.3.2",
|
||||||
"html-webpack-plugin": "^4.5.2",
|
"html-webpack-plugin": "^4.5.2",
|
||||||
"jest": "^26.6.3",
|
"jest": "^27.1.0",
|
||||||
"lerna": "^4.0.0",
|
"lerna": "^4.0.0",
|
||||||
"prettier": "^2.3.2",
|
"prettier": "^2.3.2",
|
||||||
"pug-html-loader": "^1.1.5",
|
"pug-html-loader": "^1.1.5",
|
||||||
|
@ -42,7 +42,7 @@
|
||||||
"stylelint-config-standard": "^22.0.0",
|
"stylelint-config-standard": "^22.0.0",
|
||||||
"stylelint-config-styled-components": "^0.1.1",
|
"stylelint-config-styled-components": "^0.1.1",
|
||||||
"stylelint-processor-styled-components": "^1.10.0",
|
"stylelint-processor-styled-components": "^1.10.0",
|
||||||
"ts-jest": "^26.5.6",
|
"ts-jest": "^27.0.5",
|
||||||
"ts-node": "^10.2.1",
|
"ts-node": "^10.2.1",
|
||||||
"typescript": "^4.3.5",
|
"typescript": "^4.3.5",
|
||||||
"url-loader": "^4.1.1",
|
"url-loader": "^4.1.1",
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
preset: 'ts-jest',
|
preset: 'ts-jest',
|
||||||
setupFilesAfterEnv: ['<rootDir>/tests/setup.ts'],
|
setupFilesAfterEnv: ['<rootDir>/tests/setup.ts'],
|
||||||
|
testEnvironment: 'jsdom',
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
preset: 'ts-jest',
|
preset: 'ts-jest',
|
||||||
|
testEnvironment: 'jsdom',
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
preset: 'ts-jest',
|
preset: 'ts-jest',
|
||||||
|
testEnvironment: 'jsdom',
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
preset: 'ts-jest',
|
preset: 'ts-jest',
|
||||||
setupFilesAfterEnv: ['<rootDir>/test/setup.ts'],
|
setupFilesAfterEnv: ['<rootDir>/test/setup.ts'],
|
||||||
|
testEnvironment: 'jsdom',
|
||||||
};
|
};
|
||||||
|
|
|
@ -72,7 +72,7 @@
|
||||||
"@types/semver": "^7.3.8",
|
"@types/semver": "^7.3.8",
|
||||||
"@types/supertest": "^2.0.11",
|
"@types/supertest": "^2.0.11",
|
||||||
"@types/uuid": "^8.3.1",
|
"@types/uuid": "^8.3.1",
|
||||||
"jest": "^26.6.3",
|
"jest": "^27.1.0",
|
||||||
"ncp": "^2.0.0",
|
"ncp": "^2.0.0",
|
||||||
"socketcluster-client": "^14.3.2",
|
"socketcluster-client": "^14.3.2",
|
||||||
"supertest": "^6.1.6"
|
"supertest": "^6.1.6"
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
preset: 'ts-jest',
|
preset: 'ts-jest',
|
||||||
setupFilesAfterEnv: ['<rootDir>/test/setup.ts'],
|
setupFilesAfterEnv: ['<rootDir>/test/setup.ts'],
|
||||||
|
testEnvironment: 'jsdom',
|
||||||
};
|
};
|
||||||
|
|
|
@ -72,7 +72,7 @@
|
||||||
"enzyme-to-json": "^3.6.2",
|
"enzyme-to-json": "^3.6.2",
|
||||||
"history": "^4.10.1",
|
"history": "^4.10.1",
|
||||||
"immutable": "^4.0.0-rc.14",
|
"immutable": "^4.0.0-rc.14",
|
||||||
"jest": "^26.6.3",
|
"jest": "^27.1.0",
|
||||||
"lodash.shuffle": "^4.2.0",
|
"lodash.shuffle": "^4.2.0",
|
||||||
"react": "^16.14.0",
|
"react": "^16.14.0",
|
||||||
"react-dom": "^16.14.0",
|
"react-dom": "^16.14.0",
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
preset: 'ts-jest',
|
preset: 'ts-jest',
|
||||||
|
testEnvironment: 'jsdom',
|
||||||
};
|
};
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/lodash": "^4.14.172",
|
"@types/lodash": "^4.14.172",
|
||||||
"jest": "^26.6.3",
|
"jest": "^27.1.0",
|
||||||
"redux": "^4.1.1",
|
"redux": "^4.1.1",
|
||||||
"rxjs": "^7.3.0"
|
"rxjs": "^7.3.0"
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue
Block a user