larry babby and threejs for glsl

This commit is contained in:
Sam
2024-06-24 21:24:00 +12:00
parent 87d5dc634d
commit 907ebae4c0
6474 changed files with 1279596 additions and 8 deletions

View File

@@ -0,0 +1,72 @@
// @flow strict-local
import assert from 'assert';
import sinon from 'sinon';
import Logger from '../src/Logger';
describe('Logger', () => {
let onLog;
let logDisposable;
beforeEach(() => {
onLog = sinon.spy();
logDisposable = Logger.onLog(onLog);
});
afterEach(() => {
logDisposable.dispose();
});
it('emits log diagnostics with info level', () => {
let diagnostic = {
message: 'hello',
origin: 'logger',
};
Logger.log(diagnostic);
assert(
onLog.calledWith({
level: 'info',
diagnostics: [diagnostic],
type: 'log',
}),
);
});
it('emits warn diagnostic with warn level', () => {
let diagnostic = {
message: 'zomg',
origin: 'logger',
};
Logger.warn(diagnostic);
assert(
onLog.calledWith({level: 'warn', diagnostics: [diagnostic], type: 'log'}),
);
});
it('emits error messages with error level', () => {
let diagnostic = {
message: 'oh noes',
origin: 'logger',
};
Logger.error(diagnostic);
assert(
onLog.calledWith({
level: 'error',
diagnostics: [diagnostic],
type: 'log',
}),
);
});
it('emits progress messages with progress level', () => {
Logger.progress('update');
assert(
onLog.calledWith({level: 'progress', message: 'update', type: 'log'}),
);
});
});