This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class EvensIterator { | |
constructor(realArray) { | |
this.realArray = realArray; | |
} | |
* [Symbol.iterator]() { | |
for (const n of this.realArray) { | |
if (n % 2 === 0) yield n; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Foo { | |
a: 'a'; | |
foobar?: 'foo1'; | |
} | |
interface Bar { | |
a: 'a'; | |
foobar?: 'foo2'; | |
} | |
interface OneOf { | |
a: 'a'; |