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
| const credentials = { | |
| username: process.env.USERNAME ?? '', | |
| password: process.env.PASSWORD ?? '', | |
| }; | |
| export class AuthPage { | |
| constructor(page, baseUrl = '') { | |
| this.page = page; | |
| this.baseUrl = baseUrl; | |
| } |
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
| const TRUCK = 1; | |
| function getCarByType(type) { | |
| if (type === TRUCK) { | |
| return { name: 'Super Truck' }; // imagine that it's a truck object | |
| } | |
| return { name: 'Usual Car' }; | |
| } |
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
| try { | |
| // your code is here | |
| } catch(e) { | |
| // in case of exception, handle it here | |
| } |
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
| class Report { | |
| constructor(consumer, products, preferences) { | |
| this.consumer = consumer; | |
| this.products = products; | |
| this.preferences = preferences; | |
| } | |
| } | |
| class ReportBuilder { | |
| constructor() { |
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
| // Given an array of strings, return another array containing all of its longest strings. | |
| function getAllLongestStrings(inputArray) {} |
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 function call<Ctx extends { [P in Name]: | |
| (this: Ctx, ...args: any[]) => any }, Name extends string>( | |
| ctxAndFnName: [Ctx, Name], | |
| ...args: Parameters<Ctx[Name]> | |
| ): CallEffect<SagaReturnType<Ctx[Name]> |