Skip to content

Instantly share code, notes, and snippets.

View omril1's full-sized avatar
🐣

Omri Luzon omril1

🐣
  • Testim.io
View GitHub Profile
const { context } = require('testim'); /* Magic */
describe('my dynamic scope test', () => {
let something = 'anything';// Can't access this variable, we can only use context
function addFoo() {
let name = context.getVar('name') || '';
name = name + 'foo';
context.setVar('name', name);
}
@omril1
omril1 / even-iteration-abstraction.js
Last active March 4, 2023 18:22
even-iteration-abstraction.js
class EvensIterator {
constructor(realArray) {
this.realArray = realArray;
}
* [Symbol.iterator]() {
for (const n of this.realArray) {
if (n % 2 === 0) yield n;
}
}
interface Foo {
a: 'a';
foobar?: 'foo1';
}
interface Bar {
a: 'a';
foobar?: 'foo2';
}
interface OneOf {
a: 'a';