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
attempt_CallsOnFail_IfMyApiFails() { | |
// Arrange | |
const onFail = sinon.stub(); | |
const onSucceed = sinon.stub(); | |
const externalApi = sinon.stub().returns(false); | |
const actor = new Actor({ externalApi, onFail, onSucceed }); | |
// Act | |
actor.attempt(); // internally calls externalApi |
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
actAfterDelay_CallsAction_AfterDelay() { | |
// Arrange | |
const action = sinon.stub(); | |
const clock = lolex.createClock<lolex.BrowserClock>(); | |
const delay = 100; | |
const actor = new Actor({ action, clock, delay }); | |
// Act | |
actor.actAfterDelay(); | |
clock.tick(delay); |
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
import { IComponentListing } from "./listings"; | |
import { getFunctionName } from "../utils"; | |
export const component = (componentFunction: any, initializer?: Function) => { | |
const componentFunctionName = getFunctionName(componentFunction); | |
return initializer === undefined | |
? createComponentClass(componentFunction, componentFunctionName) | |
: createComponentInitializer(componentFunction, componentFunctionName, initializer); | |
}; |
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
0 info it worked if it ends with ok | |
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe', | |
1 verbose cli 'C:\\Users\\jogol\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js', | |
1 verbose cli 'i' ] | |
2 info using npm@5.5.1 | |
3 info using node@v8.8.1 | |
4 verbose npm-session c1cc1bbe74c6487e | |
5 silly install runPreinstallTopLevelLifecycles | |
6 silly preinstall electric-boogaloo@0.1.0 | |
7 info lifecycle electric-boogaloo@0.1.0~preinstall: electric-boogaloo@0.1.0 |
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
export const createRouteDetails = (lookupId?: string): IRouteDetails => { | |
if (lookupId === undefined) { | |
return { | |
pageMode: PageMode.MySways, | |
}; | |
} | |
return { | |
lookupId, | |
pageMode: PageMode.Document, |
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
import { createEventEmitter, IEventReceiver } from "squee"; | |
import * as Selenium from "selenium-webdriver"; | |
// Put whatever you'd like in this... | |
interface IPostMessageData { | |
identifier: string; | |
} | |
declare const window: { | |
__MY_IS_EVENT_DATA_VALID__: (data: any) => data is IPostMessageData; |
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
// webpack/assets/javascripts/clipboard-polyfill.d.ts | |
// This file should be in that path 👆 but Gists don't allow subpaths... | |
// Overrides incorrect types in node_modules/clipboard-polyfill/build/clipboard-polyfill.d.ts | |
// See https://github.com/lgarron/clipboard-polyfill/issues/106 |
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
// webpack/assets/javascripts/esri.d.ts | |
// This file should be in that path 👆 but Gists don't allow subpaths... | |
declare module "esri" { | |
const wat: string; | |
export wat; | |
} |
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
// webpack/assets/javascripts/my-esri | |
// This file should be in that path 👆 but Gists don't allow subpaths... | |
// I'm not super sure this works the way I want it to | |
// In theory, this /// include should only import the types into *this* file's context, not the ambient context | |
// 🤷 | |
/// <reference path="../../../node_modules/@types/esri/index.d.ts" /> | |
export const Esri = window.Esri; |
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
type Bit = 0 | 1; | |
type BitFlip<A> = A extends 0 | |
? 1 | |
: 0; | |
type BitOr<A, B> = [A, B] extends [0, 0] | |
? 0 | |
: 1; |