-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2846 from wordpress-mobile/try/new-jest-config
- Loading branch information
Showing
6 changed files
with
48 additions
and
237 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
extends: '../gutenberg/packages/react-native-editor/__device-tests__/.eslintrc.js', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ); | ||
} ); | ||
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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', | ||
}; |
Oops, something went wrong.