-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Marc-André Rivet
committed
Oct 11, 2019
1 parent
1a7a470
commit 7c3edaa
Showing
6 changed files
with
91 additions
and
11 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module.exports = { | ||
presets: [['@babel/preset-env', { | ||
useBuiltIns: 'usage', | ||
corejs: 3 | ||
}], '@babel/preset-react'], | ||
env: { | ||
test: { | ||
plugins: [ | ||
'@babel/plugin-transform-modules-commonjs' | ||
This comment has been minimized.
Sorry, 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -163,9 +163,9 @@ module.exports = { | |
// transform: null, | ||
|
||
// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation | ||
// transformIgnorePatterns: [ | ||
// "/node_modules/" | ||
// ], | ||
transformIgnorePatterns: [ | ||
"/node_modules/(?!@plotly).+\\.js" | ||
This comment has been minimized.
Sorry, something went wrong.
Marc-Andre-Rivet
Contributor
|
||
], | ||
|
||
// An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them | ||
// unmockedModulePathPatterns: undefined, | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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,66 @@ | ||
import { notifyObservers } from "../src/actions"; | ||
|
||
const WAIT = 1000; | ||
|
||
describe('notifyObservers', () => { | ||
const thunk = notifyObservers({ | ||
id: 'id', | ||
props: {}, | ||
undefined | ||
}); | ||
|
||
it('executes if app is ready', async () => { | ||
let done = false; | ||
thunk( | ||
() => { }, | ||
() => ({ | ||
graphs: { | ||
InputGraph: { | ||
hasNode: () => false, | ||
dependenciesOf: () => [], | ||
dependantsOf: () => [], | ||
overallOrder: () => 0 | ||
} | ||
}, | ||
isAppReady: true, | ||
requestQueue: [] | ||
}) | ||
).then(() => { done = true; }); | ||
|
||
await new Promise(r => setTimeout(r, 0)); | ||
expect(done).toEqual(true); | ||
}); | ||
|
||
it('waits on app to be ready', async () => { | ||
let resolve; | ||
const isAppReady = new Promise(r => { | ||
resolve = r; | ||
}); | ||
|
||
let done = false; | ||
thunk( | ||
() => { }, | ||
() => ({ | ||
graphs: { | ||
InputGraph: { | ||
hasNode: () => false, | ||
dependenciesOf: () => [], | ||
dependantsOf: () => [], | ||
overallOrder: () => 0 | ||
} | ||
}, | ||
isAppReady, | ||
requestQueue: [] | ||
}) | ||
).then(() => { done = true; }); | ||
|
||
await new Promise(r => setTimeout(r, WAIT)); | ||
This comment has been minimized.
Sorry, something went wrong.
Marc-Andre-Rivet
Contributor
|
||
expect(done).toEqual(false); | ||
|
||
resolve(); | ||
|
||
await new Promise(r => setTimeout(r, WAIT)); | ||
expect(done).toEqual(true); | ||
}); | ||
|
||
}); |
to handle the not-previous-bundled code from
@plotly/...
packages