This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 [email protected] | |
3 info using [email protected] | |
4 verbose npm-session c1cc1bbe74c6487e | |
5 silly install runPreinstallTopLevelLifecycles | |
6 silly preinstall [email protected] | |
7 info lifecycle [email protected]~preinstall: [email protected] |
This file contains hidden or 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 hidden or 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
[Net.ServicePointManager]::SecurityProtocol = "Ssl3, Tls, Tls11, Tls12"; | |
$currentDir = (Get-Item -Path "./").FullName; | |
$driversDirName = Join-Path $currentDir ".drivers"; | |
$isWindows = [System.Boolean](Get-CimInstance -ClassName Win32_OperatingSystem -ErrorAction SilentlyContinue); | |
$webClient = New-Object System.Net.WebClient; | |
function Ensure-Driver-Exists($browserName, $exeName, $download, $zipName) { | |
$localExeName = Join-Path $driversDirName $exeName; | |
if (Test-Path $localExeName) { |
This file contains hidden or 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 hidden or 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 BitOr<A extends Bit, B extends Bit> = | |
[A, B] extends [0, 0] ? 0 : | |
[A, B] extends [0, 1] | [1, 0] | [1, 1] ? 1 : | |
Bit | |
; | |
type BitAnd<A extends Bit, B extends Bit> = | |
[A, B] extends [0, 0] | [1, 0] | [0, 1] ? 0 : |
This file contains hidden or 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 hidden or 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; | |
} |