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
// based on https://github.com/pact-foundation/pact-js/blob/master/examples/mocha/test/get-dogs.spec.js#L40-L75 | |
describe("get /dogs", () => { | |
it("returns the correct response", async () => { | |
await provider.addInteraction({ | |
state: "i have a list of dogs", | |
uponReceiving: "a request for all dogs", | |
withRequest: { | |
method: "GET", | |
path: "/dogs", |
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 defaultOptions = Object.freeze({ | |
delayMs: 0, // (ms delay on all invocations) | |
retries: 3, // (retry failed promises up to 3 times each) | |
errorDelayMs: 100, // (ms delay after first error) | |
exponential: true, // (if true then double errorDelayMs on consecutive errors) | |
throwOnError: true, // (set to false to only log errors that fail to retry) | |
keepErrors: false, // (set to true to return an Array in `.errors`) | |
logger: console, // (set to initialized lib-logger-nodejs) | |
verbose: process.env.VERBOSE || false, // (set to true to log summary of successes and errors every time) | |
errorMsg: '' // (additional error message to display if all retries fail) |
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 path = require('path') | |
const chromeArgs = [ | |
'--headless', | |
'--single-process', | |
'--disable-gpu', | |
'--disable-background-timer-throttling', | |
'--disable-breakpad', | |
'--disable-client-side-phishing-detection', | |
'--disable-cloud-import', |
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
console.log('A'); | |
const FetchKeys = new Promise((resolve, reject) => { | |
setTimeout(function () { | |
resolve('Hello world!'); | |
}, 1000); | |
}); | |
Promise.all([FetchKeys]) | |
.then(res => { |
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
console.log('A'); | |
(async () => { | |
try { | |
const result = await new Promise((resolve, reject) => { | |
resolve('B'); | |
}); | |
console.log(result); // B | |
} catch (e) { | |
console.log('caught something'); |
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
// * * * * * * * * * * * * * * * * * * * * * * * * * * * | |
// Name: Levi Willmeth Folder Name: willmeth_l | |
// CS161 Winter 2014 Assignment: Lab 1 | |
// Class time: Mon/Wed/Fri 12:00pm - 1:20 / 1:50 | |
// Program Name: initials.class | |
// Program Description: | |
// Prints my initials 'LJW' in big asci text. | |
// * * * * * * * * * * * * * * * * * * * * * * * * * * * | |
import java.util.*; // required for Collections.shuffle | |
public class initials{ // initial class must be same as filename |