Skip to content

Commit

Permalink
Merge pull request #2846 from wordpress-mobile/try/new-jest-config
Browse files Browse the repository at this point in the history
  • Loading branch information
ceyhun committed Dec 16, 2020
2 parents 1df81f6 + 23351a7 commit d898415
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 237 deletions.
3 changes: 3 additions & 0 deletions __device-tests__/.eslintrc.js
@@ -0,0 +1,3 @@
module.exports = {
extends: '../gutenberg/packages/react-native-editor/__device-tests__/.eslintrc.js',
};
36 changes: 0 additions & 36 deletions __device-tests__/gutenberg-editor-contact-info.test.js
@@ -1,48 +1,12 @@
/**
* Internal dependencies
*/
import EditorPage from '../gutenberg/packages/react-native-editor/__device-tests__/pages/editor-page';
import {
setupDriver,
isLocalEnvironment,
stopDriver,
} from '../gutenberg/packages/react-native-editor/__device-tests__/helpers/utils';

jest.setTimeout( 1000000 );

describe( 'Gutenberg Editor Contact Info Block tests', () => {
let driver;
let editorPage;
let allPassed = true;
// const contactInfoBlockName = 'Contact Info';

// Use reporter for setting status for saucelabs Job
if ( ! isLocalEnvironment() ) {
const reporter = {
specDone: async ( result ) => {
allPassed = allPassed && result.status !== 'failed';
},
};

// eslint-disable-next-line jest/no-jasmine-globals
jasmine.getEnv().addReporter( reporter );
}

beforeAll( async () => {
driver = await setupDriver();
editorPage = new EditorPage( driver );
} );

it( 'should be able to see visual editor', async () => {
await expect( editorPage.getBlockList() ).resolves.toBe( true );
} );

//TODO: Add tests

afterAll( async () => {
if ( ! isLocalEnvironment() ) {
driver.sauceJobStatus( allPassed );
}
await stopDriver( driver );
} );
} );
2 changes: 1 addition & 1 deletion gutenberg
Submodule gutenberg updated 426 files
14 changes: 6 additions & 8 deletions jest_ui.config.js
@@ -1,12 +1,10 @@
const main = require( './jest.config.js' );
const gutenbergJestUIConfig = require( './gutenberg/packages/react-native-editor/jest_ui.config.js' );

module.exports = {
...main,
timers: 'real',
setupFiles: [],
testMatch: [
'<rootDir>/__device-tests__/**/*.test.[jt]s?(x)',
'<rootDir>/gutenberg/packages/react-native-editor/__device-tests__/**/*.test.[jt]s?(x)',
...gutenbergJestUIConfig,
setupFilesAfterEnv: [
'./gutenberg/packages/react-native-editor/jest_ui_setup_after_env.js',
],
testPathIgnorePatterns: [ '/node_modules/', '<rootDir>/jetpack/' ],
testEnvironment:
'./gutenberg/packages/react-native-editor/jest_ui_test_environment.js',
};

0 comments on commit d898415

Please sign in to comment.