This commit is contained in:
Nathan Bierema 2020-11-17 14:37:19 -05:00
parent 99f83bdc2a
commit 21119dadc6
8 changed files with 10 additions and 19 deletions

View File

@ -3,6 +3,5 @@ build
dev dev
webpack/replace webpack/replace
examples examples
test/app/setup.js
npm-package npm-package
_book _book

View File

@ -1,3 +1,3 @@
module.exports = { module.exports = {
setupFiles: ['<rootDir>/test/app/setup.js'], setupFiles: ['<rootDir>/test/setup.js'],
}; };

View File

@ -18,7 +18,7 @@
"docs:publish": "npm run docs:clean && npm run docs:build && cd _book && git init && git commit --allow-empty -m 'update book' && git checkout -b gh-pages && touch .nojekyll && git add . && git commit -am 'update book' && git push git@github.com:zalmoxisus/redux-devtools-extension gh-pages --force", "docs:publish": "npm run docs:clean && npm run docs:build && cd _book && git init && git commit --allow-empty -m 'update book' && git checkout -b gh-pages && touch .nojekyll && git add . && git commit -am 'update book' && git push git@github.com:zalmoxisus/redux-devtools-extension gh-pages --force",
"clean": "rimraf build/ && rimraf dev/", "clean": "rimraf build/ && rimraf dev/",
"lint": "eslint .", "lint": "eslint .",
"test:app": "jest test/app", "test:app": "cross-env BABEL_ENV=test jest test/app",
"test:chrome": "jest test/chrome", "test:chrome": "jest test/chrome",
"test:electron": "jest test/electron && rimraf test/electron/tmp", "test:electron": "jest test/electron && rimraf test/electron/tmp",
"test": "npm run test:app && npm run build:extension && npm run test:chrome && npm run test:electron" "test": "npm run test:app && npm run build:extension && npm run test:chrome && npm run test:electron"

View File

@ -9,9 +9,7 @@ const extensionId = 'lmhkpmbekcpmknklioeibfkpmmfibljd';
const actionsPattern = /^@@INIT(.|\n)+@@reduxReactRouter\/routerDidChange(.|\n)+@@reduxReactRouter\/initRoutes(.|\n)+$/; const actionsPattern = /^@@INIT(.|\n)+@@reduxReactRouter\/routerDidChange(.|\n)+@@reduxReactRouter\/initRoutes(.|\n)+$/;
describe('Chrome extension', function () { describe('Chrome extension', function () {
this.timeout(20000); beforeAll(async () => {
before(async () => {
chromedriver.start(); chromedriver.start();
await delay(2000); await delay(2000);
this.driver = new webdriver.Builder() this.driver = new webdriver.Builder()
@ -24,7 +22,7 @@ describe('Chrome extension', function () {
.forBrowser('chrome') .forBrowser('chrome')
.build(); .build();
}); });
after(async () => { afterAll(async () => {
await this.driver.quit(); await this.driver.quit();
chromedriver.stop(); chromedriver.stop();
}); });
@ -41,10 +39,10 @@ describe('Chrome extension', function () {
}); });
it("should contain inspector monitor's component", async () => { it("should contain inspector monitor's component", async () => {
const val = this.driver const val = await this.driver
.findElement(webdriver.By.xpath('//div[contains(@class, "inspector-")]')) .findElement(webdriver.By.xpath('//div[contains(@class, "inspector-")]'))
.getText(); .getText();
expect(val).toExist(); expect(val).toBeDefined();
}); });
it('should contain an empty actions list', async () => { it('should contain an empty actions list', async () => {

View File

@ -1,2 +0,0 @@
require('@babel/register')();
require('@babel/polyfill');

View File

@ -8,9 +8,7 @@ const port = 9515;
const devPanelPath = 'chrome-extension://redux-devtools/devpanel.html'; const devPanelPath = 'chrome-extension://redux-devtools/devpanel.html';
describe('DevTools panel for Electron', function () { describe('DevTools panel for Electron', function () {
this.timeout(10000); beforeAll(async () => {
before(async () => {
chromedriver.start(); chromedriver.start();
await delay(1000); await delay(1000);
this.driver = new webdriver.Builder() this.driver = new webdriver.Builder()
@ -26,7 +24,7 @@ describe('DevTools panel for Electron', function () {
await this.driver.manage().timeouts().setScriptTimeout(10000); await this.driver.manage().timeouts().setScriptTimeout(10000);
}); });
after(async () => { afterAll(async () => {
await this.driver.quit(); await this.driver.quit();
chromedriver.stop(); chromedriver.stop();
}); });
@ -61,7 +59,7 @@ describe('DevTools panel for Electron', function () {
const className = await this.driver const className = await this.driver
.findElement(webdriver.By.className(id)) .findElement(webdriver.By.className(id))
.getAttribute('class'); .getAttribute('class');
expect(className).toNotMatch(/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 () => {
@ -91,7 +89,7 @@ describe('DevTools panel for Electron', function () {
const val = await this.driver const val = await this.driver
.findElement(webdriver.By.xpath('//div[contains(@class, "inspector-")]')) .findElement(webdriver.By.xpath('//div[contains(@class, "inspector-")]'))
.getText(); .getText();
expect(val).toExist(); expect(val).toBeDefined();
}); });
Object.keys(switchMonitorTests).forEach((description) => Object.keys(switchMonitorTests).forEach((description) =>

View File

@ -1,2 +0,0 @@
require('@babel/register')();
require('@babel/polyfill');