p5.js-web-editor/server/utils/__mocks__/createId.js

17 lines
232 B
JavaScript

/**
* Creates an increasing numeric ID
* for testing
*/
let nextId = 0;
export default function mockCreateId() {
const id = nextId;
nextId += 1;
return String(id);
}
export function resetMockCreateId() {
nextId = 0;
}