Skip to content

Instantly share code, notes, and snippets.

View ryanluker's full-sized avatar

Ryan Luker ryanluker

View GitHub Profile
{
"basics": {
"name": "Ryan Luker",
"label": "Tech Lead",
"image": "https://avatars.githubusercontent.com/u/1335972",
"email": "ryanluker@outlook.com",
"url": "https://luker.dev",
"summary": "Senior Individual Contributor with over 10 years of software development across a range of industries.",
"location": {
"city": "Kelowna",

Keybase proof

I hereby claim:

  • I am ryanluker on github.
  • I am ryanluker (https://keybase.io/ryanluker) on keybase.
  • I have a public key ASAyyJSyTUmgW0aksz1ccO4zJlzHmCFse1rChLVthaONUwo

To claim this, I am signing this object:

import * as assert from "assert";
import * as fs from "fs";
// Original functions
const readFile = fs.readFile;
teardown(function() {
(fs as any).readFile = readFile;
});
test("Run display coverage on python test file @integration", async () => {
const extension = await vscode.extensions.getExtension("ryanluker.vscode-coverage-gutters");
const getCachedLines = extension.exports;
const testCoverage = await vscode.workspace.findFiles("**/bar/a.py", "**/node_modules/**");
const testDocument = await vscode.workspace.openTextDocument(testCoverage[0]);
const testEditor = await vscode.window.showTextDocument(testDocument);
await vscode.commands.executeCommand("extension.displayCoverage");
// Wait for decorations to load
await sleep(2000);
test("Run display coverage on node test file @integration", async () => {
const extension = await vscode.extensions.getExtension("ryanluker.vscode-coverage-gutters");
const getCachedLines = extension.exports;
const testCoverage = await vscode.workspace.findFiles("**/test-coverage.js", "**/node_modules/**");
const testDocument = await vscode.workspace.openTextDocument(testCoverage[0]);
const testEditor = await vscode.window.showTextDocument(testDocument);
await vscode.commands.executeCommand("extension.displayCoverage");
// Wait for decorations to load
await sleep(2000);
test("Should start extension @integration", async () => {
const started = vscode.extensions.getExtension(
"ryanluker.vscode-coverage-gutters",
).isActive;
assert.equal(started, true);
});
@ryanluker
ryanluker / example.ts
Last active May 6, 2018 21:30
example
const a = [...base].reverse();
const b = [...comparee].reverse();
// find the intersection and reverse it back into a string
const intersection = [...a].filter((x, i) => x === b[i]).reverse().join("");
// prevent file names from returning true, the intersection must include ###'s
// from the normalize process
if (!intersection.includes("###")) return false;
@ryanluker
ryanluker / PriceLabel-test.tsx
Created April 29, 2016 13:39
testing price label and nested requires
jest.dontMock("../PriceLabel");
jest.dontMock("../../libs/helpers");
import * as React from "react";
import * as ReactDOM from "react-dom";
import * as TestUtils from "react-addons-test-utils";
import {PriceLabel} from "../PriceLabel";
describe("PriceLabel", () => {
@ryanluker
ryanluker / pricelabel.tsx
Last active May 11, 2016 05:55
price label stateless component
import * as React from "react";
import helpers from "../libs/helpers";
let h = new helpers();
export const PriceLabel = (props: {price: number}) => (
<span className="price">{h.formatPrice(props.price)}</span>
);
@ryanluker
ryanluker / AddFishButton.tsx
Last active April 29, 2016 06:06
simple stateless component
import * as React from "react";
import {AddButtonProps} from "../libs/interfaces";
export const AddFishButton = (props: AddButtonProps) => (
<button disabled={!props.isAvailable} onClick={props.addToOrder}>{props.text}</button>
);