-
Notifications
You must be signed in to change notification settings - Fork 1
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 #2 from mouafa/development
Development
- Loading branch information
Showing
23 changed files
with
906 additions
and
106 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 |
---|---|---|
|
@@ -14,6 +14,7 @@ yarn-debug.log* | |
yarn-error.log* | ||
|
||
shots/ | ||
__shots__/ | ||
ignore/ | ||
service/ | ||
*.ignore.* |
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
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,12 @@ | ||
const page = { | ||
setViewport: jest.fn(), | ||
goto: jest.fn(), | ||
screenshot: jest.fn(() => Buffer.from('mock')), | ||
close: jest.fn() | ||
} | ||
|
||
const browser = { | ||
newPage: jest.fn(() => page) | ||
} | ||
|
||
module.exports = browser |
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 @@ | ||
module.exports = jest.fn() |
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,9 @@ | ||
const royax = jest.fn(x => { | ||
throw new Error(`\n ${x} NOT MOCKED`) | ||
}) | ||
|
||
royax.mockResult = data => { | ||
royax.mockImplementationOnce(() => data) | ||
} | ||
|
||
module.exports = royax |
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
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,2 +1,10 @@ | ||
const browser = require('./__mocks__/browser.mock') | ||
const { getConfig } = require('./src/config') | ||
// const consoleLog = console.log | ||
console.log = jest.fn() | ||
|
||
/* start browser mock */ | ||
|
||
global.browser = browser | ||
global.config = getConfig() | ||
/* end browser mock */ |
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
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
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,17 @@ | ||
const path = require('path') | ||
/* local */ | ||
|
||
const viewports = require('./viewport') | ||
|
||
const resolve = pth => path.resolve(__dirname, '../../', pth) | ||
|
||
const config = { | ||
viewports, | ||
screenshotExt: 'png', | ||
tmpShotPath: resolve('.cache'), | ||
legitShotPath: resolve('__shots__/legit'), | ||
fishyShotPath: resolve('__shots__/fishy'), | ||
diffShotPath: resolve('__shots__/diff') | ||
} | ||
|
||
module.exports = config |
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
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
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
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
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,20 @@ | ||
const raport = {} | ||
|
||
function add({ url, suffix }, data) { | ||
if (!raport[url]) raport[url] = {} | ||
raport[url][suffix] = data | ||
return raport | ||
} | ||
|
||
function get() { | ||
return raport | ||
} | ||
|
||
function isObject(object) { | ||
return object !== null && typeof object === 'object' | ||
} | ||
|
||
module.exports = { | ||
add, | ||
get | ||
} |
Oops, something went wrong.