-
Notifications
You must be signed in to change notification settings - Fork 14
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 #718 from Caltech-IPAC/IRSA-2520_jest_framework
IRSA-2520: Add JavaScript Testing framework to Firefly
- Loading branch information
Showing
17 changed files
with
2,005 additions
and
179 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
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,47 @@ | ||
import * as jest from 'jest'; | ||
|
||
jest.mock('firefly/Firefly.js'); | ||
// | ||
// -- we are going to have to do something like this eventually, I think, right now I can't make it work | ||
// jest.mock('firefly/Firefly.js', () => { | ||
// return { | ||
// flux : { | ||
// process : () => {}, | ||
// getState : () => ({ | ||
// app_data : {}, | ||
// allPlots : {}, | ||
// fieldGroup: {} | ||
// }) | ||
// } | ||
// } | ||
// }); | ||
|
||
|
||
jest.mock('firefly/util/BrowserInfo.js', () => { | ||
return { | ||
getBrowserType: () => '', | ||
isIE: () => false, | ||
isSafari: () => false, | ||
isFirefox: () => false, | ||
isChrome: () => true, | ||
isBrowser: () => false, | ||
isPlatform: () => false, | ||
isVersionAtLeast: () => false, | ||
isVersionBefore: () => false, | ||
getSupportsCSS3: () => false, | ||
getSupportsCORS: () => false, | ||
getPlatformDesc: () => '', | ||
getBrowserString: () => 'chrome', | ||
isTouchInput: () => false, | ||
getVersionString: () => '1.2.3', | ||
getBrowserDesc: () => 'chrome' | ||
|
||
}; | ||
}); | ||
|
||
|
||
jest.mock('firefly/core/AppDataCntlr.js', () => { | ||
return { | ||
getAppOptions : () => ({}) | ||
} | ||
}); |
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 = 'test-file-stub'; |
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,6 @@ | ||
// Custom Jest transform implementation that wraps babel-jest and injects our | ||
// babel presets, so we don't have to use .babelrc. | ||
|
||
module.exports = require('babel-jest').createTransformer({ | ||
presets: ["env", "react", "stage-3"], | ||
}); |
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 = {}; |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.