View atom-operation-map.ts
export function* map<A>(slice: Slice<Record<string, A>>, operation: (slice: Slice<A>) => Operation<void>): Operation<void> { | |
let contexts = new Map<string,Context>(); | |
function* synchronize(record: Record<string, A>) { | |
let keep = new Set<string>(); | |
for (let key of Object.keys(record)) { | |
if (!contexts.has(key)) { | |
contexts.set(key, yield spawn(operation(slice.slice(key)))) | |
} |
View describe.ts
import { Page, TextField, Button, HTML, Heading, including } from '@bigtest/interactor'; | |
import { describe } from '@bigtest/suite/bdd'; //hypothetical bdd syntax entry point | |
import { createUser } from './helpers'; | |
export default describe("login test", function*() { | |
yield createUser("cowboyd", "password"); //=> injects `user` into context | |
yield Page.visit('/sign-in'); | |
yield Heading(including('Sign into app')).exists(); | |
yield describe("with good credentials", function*() { |
View pipelined-interactors.ts
import { Page } from 'bigtest'; | |
import { DashboardCard, Heading } from './interactors'; | |
import { test, step, child, createList } from './client-test-helpers'; | |
export default test('Admin UI: Main Dashboard') | |
|> createList('SomeEntity', 3) | |
|> Page.visit('/admin/dashboard') | |
|> Heading("Dashboard").exists() | |
|> DashboardCard("Stock Entities").exists() | |
|> child( |
View konami.ts
import { run } from 'effection'; | |
import { once } from '@effection/events'; | |
run(function*() { | |
yield konamiCodeEntered(); | |
alert('99 lives!'); | |
}); | |
function * konamiCodeEntered() { | |
while (true) { |
View operation-state.ts
type OperationState<T> = { | |
status: 'unstarted'; | |
} | { | |
status: 'started'; | |
} | { | |
status: 'running'; | |
isRunning: true; | |
} | { | |
status: 'completed'; | |
value: T; |
View nr-spa-1016.js
// modules are defined as an array | |
// [ module function, map of requires ] | |
// | |
// map of requireuires is short require name -> numeric require | |
// | |
// anything defined in a previous bundle is accessed via the | |
// orig method which is the require for previous bundles | |
(function (modules, cache, entry) { // eslint-disable-line no-extra-parens | |
// Save the require from previous bundle to this closure if any |
View wat.rs
use neon::prelude::*; | |
use winapi::shared::minwindef::{TRUE, FALSE}; | |
use winapi::um::winnt::LPSTR; | |
//use winapi::um::synchapi::{WaitForSingleObject}; | |
//use winapi::um::handleapi::CloseHandle; | |
use winapi::um::processthreadsapi::*; | |
use winapi::um::consoleapi::*; | |
use winapi::um::wincon::*; | |
use std::process::Command; |
View signin.test.json
{ | |
"description": "Sign In", | |
"steps": [ | |
{ | |
"description": "visiting \"/\"" | |
}, | |
{ | |
"description": "click on link \"Sign in\"" | |
} | |
], |
View checkin.interactors.js
import { createInteractor, App } from '@bigtest/interactor'; | |
export const Input = createInteractor('Input')({ | |
selector: 'input', | |
defaultLocator: (elem) => elem.name, | |
locators: { | |
byAriaLabel: element => element.ariaLabel | |
}, | |
actions: { | |
type: (elem, val) => { |
View index.ts
import { Server } from 'miragejs'; | |
import { createGraphQLHandler } from '@miragejs/graphql'; | |
import { schema as schemaSource } from '@self/graphql'; | |
import { factories } from './factories'; | |
export interface Simulation { | |
create<T>(modelName: string, data?: Record<string, unknown>): T; | |
createList<T>(modelName: string, count: number): T[]; |
NewerOlder