Initial commit of 001code-html Scratch frontend project.
Includes scratch-gui, scratch-vm, scratch-blocks, scratch-render, scratch-l10n, and deployment config. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
15
scratch-gui/test/__mocks__/audio-buffer-player.js
Normal file
15
scratch-gui/test/__mocks__/audio-buffer-player.js
Normal file
@@ -0,0 +1,15 @@
|
||||
export default class MockAudioBufferPlayer {
|
||||
constructor (samples, sampleRate) {
|
||||
this.samples = samples;
|
||||
this.sampleRate = sampleRate;
|
||||
this.buffer = {
|
||||
getChannelData: jest.fn(() => samples),
|
||||
sampleRate: sampleRate
|
||||
};
|
||||
this.play = jest.fn((trimStart, trimEnd, onUpdate) => {
|
||||
this.onUpdate = onUpdate;
|
||||
});
|
||||
this.stop = jest.fn();
|
||||
MockAudioBufferPlayer.instance = this;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user