-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(test-utils): Update tests to use async device creation #2226
Conversation
@@ -469,7 +485,9 @@ test('WebGLState#withGLParameters framebuffer', t => { | |||
t.end(); | |||
}); | |||
|
|||
test('WebGLState#withGLParameters empty parameters object', t => { | |||
test('WebGLState#withGLParameters empty parameters object', async t => { | |||
const webglDevice = await getWebGLTestDevice(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A lot of repetition here. Would it be worth defining a helper function webGlTest()
that passed in the created context?
webGlTest('WebGLState#withGLParameters empty parameters object', async (t, webglDevice) => {...})
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A lot of repetition here. Would it be worth defining a helper function
webGlTest()
that passed in the created context?webGlTest('WebGLState#withGLParameters empty parameters object', async (t, webglDevice) => {...})
That could be a good idea.
- We'll be moving most of the WebGL specific tests (not this file of course) to multi-platform, so we will want to call
getTestDevices()
instead ofgetWebGLTestDevice()
, but I suppose we could supply atestDevices
param. - I'd like to move to jest and I wonder if there is not a
beforeTest()
type method that could wait for the device and store it in a global var. - I tend to be a bit wary of wrapping things, it makes the code base a bit less clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One further disadvantage of the wrapper is that test.only
etc stops working
59b8ef3
to
e7631da
Compare
e7631da
to
ea9e1c1
Compare
For #
Background
Change List
Notes
getTestDevice()
andwebglDevice
exports from@luma.gl/test-utils
for now until deck.gl has moved to async tests.