Skip to content

Commit

Permalink
test: add canvas replacement test
Browse files Browse the repository at this point in the history
  • Loading branch information
seleb committed Dec 3, 2020
1 parent ee8b84e commit d2a0b7a
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions src/canvas replacement.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import {
end, press, snapshot, start,
} from './test/bitsy';

test('canvas replacement', async () => {
await start({
hacks: [
[
'canvas replacement',
{
glazyOptions: {
background: 'black',
scaleMode: 'FIT',
allowDownscaling: true,
disableFeedbackTexture: true,
fragment: `
// tint fragment shader
precision mediump float;
uniform sampler2D tex0;
uniform sampler2D tex1;
uniform float time;
uniform vec2 resolution;
void main(){
gl_FragColor = vec4(texture2D(tex0, gl_FragCoord.xy / resolution.xy).rg, 0.0, 1.0);
}`,
},
},
],
],
});
await press('Enter'); // complete title page
await press('Enter'); // end title page
await snapshot();
await end();
});

0 comments on commit d2a0b7a

Please sign in to comment.