level_0
int64
0
10k
index
int64
0
0
repo_id
stringlengths
22
152
file_path
stringlengths
41
203
content
stringlengths
11
11.5M
585
0
petrpan-code/boardgameio/boardgame.io/src
petrpan-code/boardgameio/boardgame.io/src/client/client.test.ts
/* * Copyright 2017 The boardgame.io Authors * * Use of this source code is governed by a MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. */ import { INVALID_MOVE } from '../core/constants'; import { createStore } from 'redux'; import { CreateGameReducer } f...
590
0
petrpan-code/boardgameio/boardgame.io/src
petrpan-code/boardgameio/boardgame.io/src/client/react.ssr.test.tsx
/** * @jest-environment node */ import React from 'react'; import type { BoardProps } from './react'; import { Client } from './react'; import ReactDOMServer from 'react-dom/server'; class TestBoard extends React.Component<BoardProps> { render() { return <div id="my-board">Board</div>; } } test('board is r...
591
0
petrpan-code/boardgameio/boardgame.io/src
petrpan-code/boardgameio/boardgame.io/src/client/react.test.tsx
/* * Copyright 2017 The boardgame.io Authors * * Use of this source code is governed by a MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. */ /* eslint-disable unicorn/no-array-callback-reference */ import React from 'react'; import type { BoardProps } from '...
615
0
petrpan-code/boardgameio/boardgame.io/src/client/debug
petrpan-code/boardgameio/boardgame.io/src/client/debug/tests/debug.test.ts
/* * Copyright 2019 The boardgame.io Authors * * Use of this source code is governed by a MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. */ import '@testing-library/jest-dom/extend-expect'; import { screen, fireEvent, waitFor } from '@testing-library/svelte...
619
0
petrpan-code/boardgameio/boardgame.io/src/client
petrpan-code/boardgameio/boardgame.io/src/client/transport/local.test.ts
/* * Copyright 2018 The boardgame.io Authors * * Use of this source code is governed by a MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. */ import { LocalTransport, LocalMaster, Local, GetBotPlayer } from './local'; import { gameEvent } from '../../core/act...
621
0
petrpan-code/boardgameio/boardgame.io/src/client
petrpan-code/boardgameio/boardgame.io/src/client/transport/socketio.test.ts
/* * Copyright 2017 The boardgame.io Authors * * Use of this source code is governed by a MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. */ import { SocketIOTransport } from './socketio'; import type * as ioNamespace from 'socket.io-client'; import { makeMo...
623
0
petrpan-code/boardgameio/boardgame.io/src/client
petrpan-code/boardgameio/boardgame.io/src/client/transport/transport.test.ts
import { Transport } from './transport'; import { ProcessGameConfig } from '../../core/game'; describe('Transport', () => { class SimpleTransport extends Transport { connect() {} disconnect() {} sendAction() {} sendChatMessage() {} requestSync() {} updateMatchID() {} updatePlayerID() {} ...
630
0
petrpan-code/boardgameio/boardgame.io/src
petrpan-code/boardgameio/boardgame.io/src/core/flow.test.ts
/* * Copyright 2017 The boardgame.io Authors * * Use of this source code is governed by a MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. */ import { makeMove, gameEvent } from './action-creators'; import { Client } from '../client/client'; import { Flow } f...
633
0
petrpan-code/boardgameio/boardgame.io/src
petrpan-code/boardgameio/boardgame.io/src/core/game.test.ts
/* * Copyright 2018 The boardgame.io Authors * * Use of this source code is governed by a MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. */ import { ProcessGameConfig } from './game'; import { Client } from '../client/client'; import { error } from '../core...
638
0
petrpan-code/boardgameio/boardgame.io/src
petrpan-code/boardgameio/boardgame.io/src/core/player-view.test.ts
/* * Copyright 2017 The boardgame.io Authors * * Use of this source code is governed by a MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. */ import { PlayerView } from './player-view'; import type { Ctx } from '../types'; test('no change', () => { const G...
640
0
petrpan-code/boardgameio/boardgame.io/src
petrpan-code/boardgameio/boardgame.io/src/core/reducer.test.ts
/* * Copyright 2017 The boardgame.io Authors * * Use of this source code is governed by a MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. */ import { INVALID_MOVE } from './constants'; import { applyMiddleware, createStore } from 'redux'; import { CreateGame...
642
0
petrpan-code/boardgameio/boardgame.io/src
petrpan-code/boardgameio/boardgame.io/src/core/turn-order.test.ts
/* * Copyright 2017 The boardgame.io Authors * * Use of this source code is governed by a MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. */ import { Flow } from './flow'; import { Client } from '../client/client'; import { UpdateTurnOrderState, Stage, ...
644
0
petrpan-code/boardgameio/boardgame.io/src
petrpan-code/boardgameio/boardgame.io/src/lobby/client.test.ts
// Tell ESLint about additional assertion methods. /* eslint jest/expect-expect: [ "warn", { "assertFunctionNames": ["expect", "throwsWith*", "testBasicBody"] } ] */ import { LobbyClient } from './client'; const throwsWithoutBody = (fn: (...args: any) => Promise<any>) => async () => { await expect(fn('tic-tac-t...
646
0
petrpan-code/boardgameio/boardgame.io/src
petrpan-code/boardgameio/boardgame.io/src/lobby/connection.test.ts
/* * Copyright 2018 The boardgame.io Authors * * Use of this source code is governed by a MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. */ import { LobbyConnection } from './connection'; import type { LobbyAPI } from '../types'; describe('lobby', () => { ...
651
0
petrpan-code/boardgameio/boardgame.io/src
petrpan-code/boardgameio/boardgame.io/src/lobby/react.ssr.test.tsx
/** * @jest-environment node */ import React from 'react'; import Lobby from './react'; import ReactDOMServer from 'react-dom/server'; /* mock server requests */ global.fetch = jest .fn() .mockReturnValue({ ok: true, status: 200, json: () => [] }); describe('lobby', () => { test('is rendered', () => { co...
652
0
petrpan-code/boardgameio/boardgame.io/src
petrpan-code/boardgameio/boardgame.io/src/lobby/react.test.tsx
/* * Copyright 2018 The boardgame.io Authors * * Use of this source code is governed by a MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. */ import React from 'react'; import Cookies from 'react-cookies'; import Lobby from './react'; import Enzyme from 'enzy...
654
0
petrpan-code/boardgameio/boardgame.io/src
petrpan-code/boardgameio/boardgame.io/src/master/filter-player-view.test.ts
import { getFilterPlayerView, redactLog } from './filter-player-view'; import * as ActionCreators from '../core/action-creators'; import { Master } from './master'; import { InMemory } from '../server/db/inmemory'; import { PlayerView } from '../core/player-view'; import { INVALID_MOVE } from '../core/constants'; impor...
656
0
petrpan-code/boardgameio/boardgame.io/src
petrpan-code/boardgameio/boardgame.io/src/master/master.test.ts
/* * Copyright 2018 The boardgame.io Authors * * Use of this source code is governed by a MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. */ import * as ActionCreators from '../core/action-creators'; import { InitializeGame } from '../core/initialize'; impor...
658
0
petrpan-code/boardgameio/boardgame.io/src
petrpan-code/boardgameio/boardgame.io/src/plugins/main.test.ts
/* * Copyright 2019 The boardgame.io Authors * * Use of this source code is governed by a MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. */ import { Client } from '../client/client'; import { Local } from '../client/transport/local'; import type { Game, Plu...
661
0
petrpan-code/boardgameio/boardgame.io/src
petrpan-code/boardgameio/boardgame.io/src/plugins/plugin-immer.test.ts
/* * Copyright 2019 The boardgame.io Authors * * Use of this source code is governed by a MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. */ import { Client } from '../client/client'; import type { _ClientImpl } from '../client/client'; import { INVALID_MOVE...
663
0
petrpan-code/boardgameio/boardgame.io/src
petrpan-code/boardgameio/boardgame.io/src/plugins/plugin-log.test.ts
/* * Copyright 2019 The boardgame.io Authors * * Use of this source code is governed by a MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. */ import { Client } from '../client/client'; import type { Game } from '../types'; describe('log-metadata', () => { ...
665
0
petrpan-code/boardgameio/boardgame.io/src
petrpan-code/boardgameio/boardgame.io/src/plugins/plugin-player.test.ts
/* * Copyright 2018 The boardgame.io Authors * * Use of this source code is governed by a MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. */ import PluginPlayer from './plugin-player'; import type { PlayerAPI } from './plugin-player'; import { Client } from ...
668
0
petrpan-code/boardgameio/boardgame.io/src
petrpan-code/boardgameio/boardgame.io/src/plugins/plugin-serializable.test.ts
import { Client } from '../client/client'; import type { Game } from '../types'; describe('plugin-serializable', () => { let client: ReturnType<typeof Client>; beforeAll(() => { const game: Game = { moves: { serializable: () => { return { hello: 'world' }; }, nonSerial...
670
0
petrpan-code/boardgameio/boardgame.io/src/plugins
petrpan-code/boardgameio/boardgame.io/src/plugins/events/events.test.ts
/* * Copyright 2018 The boardgame.io Authors * * Use of this source code is governed by a MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. */ import { Events } from './events'; import { Client } from '../../client/client'; import { error } from '../../core/lo...
673
0
petrpan-code/boardgameio/boardgame.io/src/plugins
petrpan-code/boardgameio/boardgame.io/src/plugins/random/random.test.ts
/* * Copyright 2017 The boardgame.io Authors * * Use of this source code is governed by a MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. */ import { Random } from './random'; import { makeMove } from '../../core/action-creators'; import { CreateGameReducer ...
675
0
petrpan-code/boardgameio/boardgame.io/src
petrpan-code/boardgameio/boardgame.io/src/server/api.test.ts
/* * Copyright 2018 The boardgame.io Authors * * Use of this source code is governed by a MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. */ import request from 'supertest'; import Koa from 'koa'; import Router from '@koa/router'; import * as dateMock from '...
677
0
petrpan-code/boardgameio/boardgame.io/src
petrpan-code/boardgameio/boardgame.io/src/server/auth.test.ts
import { extractPlayerMetadata, doesMatchRequireAuthentication, areCredentialsAuthentic, Auth, } from './auth'; import type { Server } from '../types'; describe('extractPlayerMetadata', () => { describe('when metadata is not found', () => { test('then playerMetadata is undefined', () => { expect(e...
679
0
petrpan-code/boardgameio/boardgame.io/src
petrpan-code/boardgameio/boardgame.io/src/server/cors.test.ts
import { EventEmitter } from 'events'; import cors from 'cors'; import type { Origins as OriginsTS } from './cors'; let { Origins } = require('./cors') as { Origins: typeof OriginsTS }; describe('localhost origin', () => { const middleware = cors({ origin: [Origins.LOCALHOST] }); test('allows localhost', () => { ...
681
0
petrpan-code/boardgameio/boardgame.io/src
petrpan-code/boardgameio/boardgame.io/src/server/index.test.ts
/* * Copyright 2017 The boardgame.io Authors * * Use of this source code is governed by a MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. */ import request from 'supertest'; import { Server, createServerRunConfig, getPortFromServer } from '.'; import type {...
685
0
petrpan-code/boardgameio/boardgame.io/src/server
petrpan-code/boardgameio/boardgame.io/src/server/db/flatfile.test.ts
/* * Copyright 2017 The boardgame.io Authors * * Use of this source code is governed by a MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. */ import { FlatFile } from './flatfile'; import type { State, Server, LogEntry } from '../../types'; describe('FlatFil...
687
0
petrpan-code/boardgameio/boardgame.io/src/server
petrpan-code/boardgameio/boardgame.io/src/server/db/index.test.ts
import { DBFromEnv, FlatFile } from '.'; test('FLATFILE_DIR', () => { process.env.FLATFILE_DIR = 'test'; const db = DBFromEnv(); expect(db).toBeInstanceOf(FlatFile); delete process.env.FLATFILE_DIR; });
689
0
petrpan-code/boardgameio/boardgame.io/src/server
petrpan-code/boardgameio/boardgame.io/src/server/db/inmemory.test.ts
/* * Copyright 2017 The boardgame.io Authors * * Use of this source code is governed by a MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. */ import { InMemory } from './inmemory'; import type { State, Server } from '../../types'; describe('InMemory', () => ...
691
0
petrpan-code/boardgameio/boardgame.io/src/server
petrpan-code/boardgameio/boardgame.io/src/server/db/localstorage.test.ts
import { nanoid } from 'nanoid'; import { LocalStorage } from './localstorage'; import type { State, Server } from '../../types'; describe('LocaLStorage', () => { let db: LocalStorage; beforeAll(() => { db = new LocalStorage(nanoid()); db.connect(); }); // Must return undefined when no game exists. ...
693
0
petrpan-code/boardgameio/boardgame.io/src/server
petrpan-code/boardgameio/boardgame.io/src/server/transport/socketio-simultaneous.test.ts
/* * Copyright 2018 The boardgame.io Authors * * Use of this source code is governed by a MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. */ import type { SocketOpts } from './socketio'; import { SocketIO } from './socketio'; import { Auth } from '../auth'; ...
694
0
petrpan-code/boardgameio/boardgame.io/src/server
petrpan-code/boardgameio/boardgame.io/src/server/transport/socketio.test.ts
/* * Copyright 2018 The boardgame.io Authors * * Use of this source code is governed by a MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. */ import type { SocketOpts } from './socketio'; import { TransportAPI, SocketIO } from './socketio'; import { Auth } fr...
697
0
petrpan-code/boardgameio/boardgame.io/src/server/transport
petrpan-code/boardgameio/boardgame.io/src/server/transport/pubsub/in-memory-pub-sub.test.ts
import { InMemoryPubSub } from './in-memory-pub-sub'; const CHANNEL_FOO = 'foo'; describe('in-memory pubsub', () => { it('should receive message from subscription', () => { const pubSub = new InMemoryPubSub<string>(); const callback = jest.fn(); pubSub.subscribe(CHANNEL_FOO, callback); const payload...
699
0
petrpan-code/boardgameio/boardgame.io/src
petrpan-code/boardgameio/boardgame.io/src/testing/mock-random.test.ts
import { Client } from '../client/client'; import type { Game } from '../types'; import { MockRandom } from './mock-random'; test('it creates a plugin object', () => { const plugin = MockRandom(); expect(plugin).toEqual({ name: 'random', noClient: expect.any(Function), api: expect.any(Function), se...
742
0
petrpan-code/clauderic/dnd-kit/packages/accessibility
petrpan-code/clauderic/dnd-kit/packages/accessibility/test/accessibility.test.tsx
describe('@dnd-kit/accessibility', () => { it('works', () => { expect(true).toBe(true); }); }); export {};
878
0
petrpan-code/clauderic/dnd-kit/packages/core
petrpan-code/clauderic/dnd-kit/packages/core/test/core.test.tsx
describe('@dnd-kit/core', () => { it('works', () => { expect(true).toBe(true); }); }); export {};
894
0
petrpan-code/clauderic/dnd-kit/packages/modifiers
petrpan-code/clauderic/dnd-kit/packages/modifiers/test/modifiers.test.tsx
import type {Modifier, ClientRect} from '@dnd-kit/core'; import type {FirstArgument, Transform} from '@dnd-kit/utilities'; import {restrictToHorizontalAxis, restrictToVerticalAxis} from '../src'; describe('@dnd-kit/modifiers', () => { const defaultRect: ClientRect = { left: 0, right: 0, top: 0, bott...
929
0
petrpan-code/clauderic/dnd-kit/packages/sortable
petrpan-code/clauderic/dnd-kit/packages/sortable/test/sortable.test.tsx
describe('@dnd-kit/sortable', () => { it('works', () => { expect(true).toBe(true); }); }); export {};
962
0
petrpan-code/clauderic/dnd-kit/packages/utilities/src
petrpan-code/clauderic/dnd-kit/packages/utilities/src/test/utilities.test.ts
describe('@dnd-kit/utilities', () => { it('works', () => { expect(true).toBe(true); }); }); export {};
1,159
0
petrpan-code/FormidableLabs/spectacle/packages/create-spectacle
petrpan-code/FormidableLabs/spectacle/packages/create-spectacle/src/cli.test.ts
import path from 'node:path'; import { exec } from 'node:child_process'; import fs from 'node:fs/promises'; import { generateImportMap } from './generators/one-page'; const CLI_PATH = path.resolve(__dirname, '../bin/cli.js'); const TMP_PATH = path.resolve(__dirname, '../tmp'); const OUT_NAME = 'my-deck'; const OUT_PAT...
1,173
0
petrpan-code/FormidableLabs/spectacle/packages/create-spectacle
petrpan-code/FormidableLabs/spectacle/packages/create-spectacle/test/e2e.test.ts
import type { Browser, Page } from 'puppeteer'; import puppeteer from 'puppeteer'; import { getLaunchOptions } from './util'; // Make the test timeout longer to accomodate Puppeteer startup jest.setTimeout(20000); describe('App.js', () => { let browser: Browser; let page: Page; beforeAll(async () => { cons...
1,189
0
petrpan-code/FormidableLabs/spectacle/packages/spectacle/src
petrpan-code/FormidableLabs/spectacle/packages/spectacle/src/components/animated-progress.test.tsx
import { PropsWithChildren, ReactElement } from 'react'; import { ThemeProvider } from 'styled-components'; import { DeckContext, DeckContextType } from './deck/deck'; import defaultTheme from '../theme/default-theme'; import AnimatedProgress from './animated-progress'; import { DeepPartial } from '../types/deep-parti...
1,200
0
petrpan-code/FormidableLabs/spectacle/packages/spectacle/src
petrpan-code/FormidableLabs/spectacle/packages/spectacle/src/components/progress.test.tsx
import { PropsWithChildren, ReactElement } from 'react'; import { ThemeProvider } from 'styled-components'; import { DeckContext, DeckContextType } from './deck/deck'; import defaultTheme from '../theme/default-theme'; import Progress from './progress'; import { DeepPartial } from '../types/deep-partial'; import { ren...
1,202
0
petrpan-code/FormidableLabs/spectacle/packages/spectacle/src
petrpan-code/FormidableLabs/spectacle/packages/spectacle/src/components/slide-layout.test.tsx
import { ReactElement } from 'react'; import { render, screen } from '@testing-library/react'; import Deck from './deck'; import SlideLayout from './slide-layout'; import { Heading, Text } from './typography'; const renderInDeck = (tree: ReactElement | JSX.Element) => render(<Deck>{tree}</Deck>); describe('SlideLay...
1,204
0
petrpan-code/FormidableLabs/spectacle/packages/spectacle/src
petrpan-code/FormidableLabs/spectacle/packages/spectacle/src/components/table.test.tsx
import { PropsWithChildren, ReactElement } from 'react'; import { ThemeProvider } from 'styled-components'; import defaultTheme from '../theme/default-theme'; import { Table, TableRow, TableCell, TableBody, TableHeader } from './table'; import { render } from '@testing-library/react'; const mountWithTheme = (tree: Re...
1,207
0
petrpan-code/FormidableLabs/spectacle/packages/spectacle/src
petrpan-code/FormidableLabs/spectacle/packages/spectacle/src/components/typography.test.tsx
import { PropsWithChildren, ReactElement } from 'react'; import { ThemeProvider } from 'styled-components'; import defaultTheme from '../theme/default-theme'; import { Text, Heading, Quote, OrderedList, UnorderedList, ListItem, Link, CodeSpan } from './typography'; import { render } from '@testing-libr...
1,214
0
petrpan-code/FormidableLabs/spectacle/packages/spectacle/src/components
petrpan-code/FormidableLabs/spectacle/packages/spectacle/src/components/deck/deck.test.tsx
import Deck from './index'; import Slide from '../slide/slide'; import { act, render } from '@testing-library/react'; import { CSSObject } from 'styled-components'; import { Stepper } from '../appear'; describe('<Deck />', () => { beforeEach(() => { jest.useFakeTimers(); }); afterEach(() => { jest.useRe...
1,221
0
petrpan-code/FormidableLabs/spectacle/packages/spectacle/src/components
petrpan-code/FormidableLabs/spectacle/packages/spectacle/src/components/markdown/markdown.test.tsx
import { ReactElement } from 'react'; import { Markdown, MarkdownSlideSet } from './markdown'; import Deck from '../deck'; import { Heading } from '../typography'; import Slide from '../slide/slide'; import { render } from '@testing-library/react'; import { MarkdownSlide } from './markdown-slide-renderer'; const mount...
1,231
0
petrpan-code/FormidableLabs/spectacle/packages/spectacle/src
petrpan-code/FormidableLabs/spectacle/packages/spectacle/src/hooks/use-deck-state.test.ts
import { renderHook, act } from '@testing-library/react'; import useDeckState, { DeckView } from './use-deck-state'; describe('useDeckState', () => { const initialState: DeckView = { slideIndex: 1, stepIndex: 1 }; /** * The INITIALIZE_TO should set the active and pending views * to the values prov...
1,233
0
petrpan-code/FormidableLabs/spectacle/packages/spectacle/src
petrpan-code/FormidableLabs/spectacle/packages/spectacle/src/hooks/use-full-screen.test.tsx
import { useToggleFullScreen } from './use-full-screen'; import { fireEvent, render } from '@testing-library/react'; import '@testing-library/jest-dom'; const oldDocumentFullscreenElement = document.fullscreenElement; const setHasFullScreenElement = (hasElement: boolean) => { Object.defineProperty(document, 'fullscr...
1,236
0
petrpan-code/FormidableLabs/spectacle/packages/spectacle/src
petrpan-code/FormidableLabs/spectacle/packages/spectacle/src/hooks/use-modes.test.ts
import '@testing-library/jest-dom'; import { renderHook } from '@testing-library/react'; import { SPECTACLE_MODES } from '../utils/constants'; import useModes from './use-modes'; const { location: locationBefore } = window; describe('useModes', () => { beforeAll(() => { Object.defineProperty(window, 'location',...
1,249
0
petrpan-code/FormidableLabs/spectacle/packages/spectacle/src
petrpan-code/FormidableLabs/spectacle/packages/spectacle/src/utils/clamp.test.ts
import clamp, { toFiniteNumber } from './clamp'; describe('toFiniteNumber', () => { it('should return 0 for NaN', () => { expect(toFiniteNumber(NaN)).toBe(0); expect(toFiniteNumber(Number.NaN)).toBe(0); }); it('should convert finite values to finite numbers', () => { expect(toFiniteNumber(123)).toBe...
1,252
0
petrpan-code/FormidableLabs/spectacle/packages/spectacle/src
petrpan-code/FormidableLabs/spectacle/packages/spectacle/src/utils/indent-normalizer.test.ts
import indentNormalizer from './indent-normalizer'; describe('indentNormalizer', () => { it('handles empty cases', () => { // @ts-ignore expect(indentNormalizer()).toEqual(''); // @ts-ignore expect(indentNormalizer(null)).toEqual(''); expect(indentNormalizer('')).toEqual(''); expect(indentNor...
1,255
0
petrpan-code/FormidableLabs/spectacle/packages/spectacle/src
petrpan-code/FormidableLabs/spectacle/packages/spectacle/src/utils/notes.test.ts
import { isolateNotes, removeNotes } from './notes'; describe('isolate notes', () => { it('returns empty string when there are no notes', () => { expect( isolateNotes(` # Test Title `) ).toEqual(''); }); it('returns the given notes', () => { expect( isolateNotes(` # test title ...
1,257
0
petrpan-code/FormidableLabs/spectacle/packages/spectacle/src
petrpan-code/FormidableLabs/spectacle/packages/spectacle/src/utils/platform-keys.test.ts
import { isPlatformMacOS, getKeyForOS, prettifyShortcut } from './platform-keys'; const { navigator: navigatorBefore } = window; describe('platform-keys', () => { beforeAll(() => { Object.defineProperty(window, 'navigator', { writable: true }); }); afterAll(() => { window.navigator = na...
1,259
0
petrpan-code/FormidableLabs/spectacle/packages/spectacle/src
petrpan-code/FormidableLabs/spectacle/packages/spectacle/src/utils/remark-rehype-directive.test.ts
import { directiveParserPlugin, directivesHandlerPlugin } from './remark-rehype-directive'; describe('directiveParserPlugin', () => { it('should transform line directives', () => { const tree = { type: 'root', children: [ { type: 'paragraph', children: [ { ...
1,262
0
petrpan-code/FormidableLabs/spectacle/packages/spectacle/src
petrpan-code/FormidableLabs/spectacle/packages/spectacle/src/utils/separate-sections-from-json.test.ts
import { separateSectionsFromJson } from './separate-sections-from-json'; describe('separateSectionsFromJson', () => { test('should separate sections and parse JSON objects', () => { const json = ` --- {"name":"carlos"} # Slide 1 Slide 1 Content --- # Slide 2 Slide 2 Content `.trim(); const section...
1,265
0
petrpan-code/FormidableLabs/spectacle/packages/spectacle/src
petrpan-code/FormidableLabs/spectacle/packages/spectacle/src/utils/use-auto-play.test.ts
import { renderHook } from '@testing-library/react'; import { useAutoPlay } from './use-auto-play'; describe('useAutoPlay()', () => { const stepForward = jest.fn(); beforeEach(() => { jest.useFakeTimers(); jest.clearAllMocks(); }); afterEach(() => { jest.useRealTimers(); }); test('should cal...
1,267
0
petrpan-code/FormidableLabs/spectacle/packages/spectacle/src
petrpan-code/FormidableLabs/spectacle/packages/spectacle/src/utils/use-timer.test.ts
import { renderHook, act } from '@testing-library/react'; import { useTimer } from './use-timer'; describe('useTimer', () => { jest.useFakeTimers(); test('should call the handler with correct time delay at the specified period', () => { const handler = jest.fn(); const period = 1313; const isActive = ...
2,167
0
petrpan-code/aws-amplify/amplify-js/packages/adapter-nextjs
petrpan-code/aws-amplify/amplify-js/packages/adapter-nextjs/__tests__/createServerRunner.test.ts
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 import { ResourcesConfig, sharedInMemoryStorage } from '@aws-amplify/core'; import { NextServer } from '../src/types'; const mockAmplifyConfig: ResourcesConfig = { Auth: { Cognito: { identityPoolId: '123...
2,168
0
petrpan-code/aws-amplify/amplify-js/packages/adapter-nextjs/__tests__
petrpan-code/aws-amplify/amplify-js/packages/adapter-nextjs/__tests__/api/generateServerClient.test.ts
import { ResourcesConfig } from '@aws-amplify/core'; import { generateServerClientUsingCookies, generateServerClientUsingReqRes, } from '../../src/api'; import { getAmplifyConfig, createRunWithAmplifyServerContext, } from '../../src/utils'; import { NextApiRequestMock, NextApiResponseMock } from '../mocks/headers';...
2,170
0
petrpan-code/aws-amplify/amplify-js/packages/adapter-nextjs/__tests__
petrpan-code/aws-amplify/amplify-js/packages/adapter-nextjs/__tests__/utils/createCookieStorageAdapterFromNextServerContext.test.ts
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 import { enableFetchMocks } from 'jest-fetch-mock'; // Make global Request available during test enableFetchMocks(); import { NextRequest, NextResponse } from 'next/server.js'; import { cookies } from 'next/h...
2,171
0
petrpan-code/aws-amplify/amplify-js/packages/adapter-nextjs/__tests__
petrpan-code/aws-amplify/amplify-js/packages/adapter-nextjs/__tests__/utils/getAmplifyConfig.test.ts
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 import { getAmplifyConfig } from '../../src/utils/getAmplifyConfig'; describe('getAmplifyConfig', () => { const mockLegacyConfig = { aws_project_region: 'us-west-2', aws_cognito_identity_pool_id: '123', ...
2,194
0
petrpan-code/aws-amplify/amplify-js/packages/analytics/__tests__
petrpan-code/aws-amplify/amplify-js/packages/analytics/__tests__/apis/disable.test.ts
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 import { disable } from '../../src/apis'; import { disableAnalytics } from '../../src/utils'; jest.mock('../../src/utils'); describe('Pinpoint APIs: disable', () => { const mockDisableAnalytics = disableAnal...
2,195
0
petrpan-code/aws-amplify/amplify-js/packages/analytics/__tests__
petrpan-code/aws-amplify/amplify-js/packages/analytics/__tests__/apis/enable.test.ts
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 import { enable } from '../../src/apis'; import { enableAnalytics } from '../../src/utils'; jest.mock('../../src/utils'); describe('Pinpoint APIs: enable', () => { const mockEnableAnalytics = enableAnalytics...
2,196
0
petrpan-code/aws-amplify/amplify-js/packages/analytics/__tests__/providers/kinesis-firehose
petrpan-code/aws-amplify/amplify-js/packages/analytics/__tests__/providers/kinesis-firehose/apis/flushEvents.test.ts
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 import { getEventBuffer, resolveConfig, } from '../../../../src/providers/kinesis-firehose/utils'; import { resolveCredentials } from '../../../../src/utils'; import { mockKinesisConfig, mockCredentialConfi...
2,197
0
petrpan-code/aws-amplify/amplify-js/packages/analytics/__tests__/providers/kinesis-firehose
petrpan-code/aws-amplify/amplify-js/packages/analytics/__tests__/providers/kinesis-firehose/apis/record.test.ts
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 import { getEventBuffer, resolveConfig, } from '../../../../src/providers/kinesis-firehose/utils'; import { isAnalyticsEnabled, resolveCredentials } from '../../../../src/utils'; import { mockKinesisConfig, ...
2,198
0
petrpan-code/aws-amplify/amplify-js/packages/analytics/__tests__/providers/kinesis-firehose
petrpan-code/aws-amplify/amplify-js/packages/analytics/__tests__/providers/kinesis-firehose/utils/getEventBuffer.test.ts
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 import { getEventBuffer } from '../../../../src/providers/kinesis-firehose/utils'; import { EventBuffer } from '../../../../src/utils'; import { mockBufferConfig, mockCredentialConfig, mockKinesisConfig, } f...
2,199
0
petrpan-code/aws-amplify/amplify-js/packages/analytics/__tests__/providers/kinesis-firehose
petrpan-code/aws-amplify/amplify-js/packages/analytics/__tests__/providers/kinesis-firehose/utils/resolveConfig.test.ts
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 import { Amplify } from '@aws-amplify/core'; import { resolveConfig } from '../../../../src/providers/kinesis-firehose/utils'; import { DEFAULT_KINESIS_FIREHOSE_CONFIG } from '../../../../src/providers/kinesis-...
2,200
0
petrpan-code/aws-amplify/amplify-js/packages/analytics/__tests__/providers/kinesis
petrpan-code/aws-amplify/amplify-js/packages/analytics/__tests__/providers/kinesis/apis/flushEvents.test.ts
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 import { resolveConfig } from '../../../../src/providers/kinesis/utils/resolveConfig'; import { resolveCredentials } from '../../../../src/utils'; import { mockKinesisConfig, mockCredentialConfig, } from '../...
2,201
0
petrpan-code/aws-amplify/amplify-js/packages/analytics/__tests__/providers/kinesis
petrpan-code/aws-amplify/amplify-js/packages/analytics/__tests__/providers/kinesis/apis/record.test.ts
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 import { getEventBuffer } from '../../../../src/providers/kinesis/utils/getEventBuffer'; import { resolveConfig } from '../../../../src/providers/kinesis/utils/resolveConfig'; import { isAnalyticsEnabled, resol...
2,202
0
petrpan-code/aws-amplify/amplify-js/packages/analytics/__tests__/providers/kinesis
petrpan-code/aws-amplify/amplify-js/packages/analytics/__tests__/providers/kinesis/utils/getEventBuffer.test.ts
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 import { getEventBuffer } from '../../../../src/providers/kinesis/utils/getEventBuffer'; import { EventBuffer } from '../../../../src/utils'; import { mockBufferConfig, mockKinesisConfig, mockCredentialConfi...
2,203
0
petrpan-code/aws-amplify/amplify-js/packages/analytics/__tests__/providers/kinesis
petrpan-code/aws-amplify/amplify-js/packages/analytics/__tests__/providers/kinesis/utils/resolveConfig.test.ts
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 import { Amplify } from '@aws-amplify/core'; import { resolveConfig } from '../../../../src/providers/kinesis/utils/resolveConfig'; import { DEFAULT_KINESIS_CONFIG } from '../../../../src/providers/kinesis/util...
2,204
0
petrpan-code/aws-amplify/amplify-js/packages/analytics/__tests__/providers/personalize
petrpan-code/aws-amplify/amplify-js/packages/analytics/__tests__/providers/personalize/apis/flushEvents.test.ts
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 import { getEventBuffer, resolveConfig, } from '../../../../src/providers/personalize/utils'; import { resolveCredentials } from '../../../../src/utils'; import { mockCredentialConfig, mockPersonalizeConfig...
2,205
0
petrpan-code/aws-amplify/amplify-js/packages/analytics/__tests__/providers/personalize
petrpan-code/aws-amplify/amplify-js/packages/analytics/__tests__/providers/personalize/apis/record.test.ts
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 import { autoTrackMedia, getEventBuffer, resolveCachedSession, resolveConfig, updateCachedSession, } from '../../../../src/providers/personalize/utils'; import { isAnalyticsEnabled, resolveCredentials } fro...
2,206
0
petrpan-code/aws-amplify/amplify-js/packages/analytics/__tests__/providers/personalize
petrpan-code/aws-amplify/amplify-js/packages/analytics/__tests__/providers/personalize/utils/cachedSession.test.ts
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 import { Cache } from '@aws-amplify/core'; import { isBrowser, amplifyUuid } from '@aws-amplify/core/internals/utils'; import { resolveCachedSession, updateCachedSession, } from '../../../../src/providers/per...
2,207
0
petrpan-code/aws-amplify/amplify-js/packages/analytics/__tests__/providers/personalize
petrpan-code/aws-amplify/amplify-js/packages/analytics/__tests__/providers/personalize/utils/getEventBuffer.test.ts
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 import { EventBuffer } from '../../../../src/utils'; import { mockBufferConfig, mockPersonalizeConfig, mockCredentialConfig, } from '../../../testUtils/mockConstants.test'; import { getEventBuffer } from '.....
2,208
0
petrpan-code/aws-amplify/amplify-js/packages/analytics/__tests__/providers/personalize
petrpan-code/aws-amplify/amplify-js/packages/analytics/__tests__/providers/personalize/utils/resolveConfig.test.ts
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 import { Amplify } from '@aws-amplify/core'; import { resolveConfig } from '../../../../src/providers/personalize/utils'; import { DEFAULT_PERSONALIZE_CONFIG, PERSONALIZE_FLUSH_SIZE_MAX, } from '../../../../s...
2,209
0
petrpan-code/aws-amplify/amplify-js/packages/analytics/__tests__/providers/pinpoint
petrpan-code/aws-amplify/amplify-js/packages/analytics/__tests__/providers/pinpoint/apis/configureAutoTrack.test.ts
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 import { ConfigureAutoTrackInput } from '../../../../src/providers/pinpoint'; import { EventTracker, PageViewTracker, SessionTracker, } from '../../../../src/trackers'; jest.mock('../../../../src/trackers')...
2,210
0
petrpan-code/aws-amplify/amplify-js/packages/analytics/__tests__/providers/pinpoint
petrpan-code/aws-amplify/amplify-js/packages/analytics/__tests__/providers/pinpoint/apis/flushEvents.test.ts
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 import { resolveConfig, resolveCredentials, } from '../../../../src/providers/pinpoint/utils'; import { config, credentials, identityId } from './testUtils/data'; import { flushEvents } from '../../../../src'...
2,211
0
petrpan-code/aws-amplify/amplify-js/packages/analytics/__tests__/providers/pinpoint
petrpan-code/aws-amplify/amplify-js/packages/analytics/__tests__/providers/pinpoint/apis/identifyUser.test.ts
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 import { updateEndpoint } from '@aws-amplify/core/internals/providers/pinpoint'; import { identifyUser } from '../../../../src/providers/pinpoint/apis'; import { IdentifyUserInput } from '../../../../src/provid...
2,212
0
petrpan-code/aws-amplify/amplify-js/packages/analytics/__tests__/providers/pinpoint
petrpan-code/aws-amplify/amplify-js/packages/analytics/__tests__/providers/pinpoint/apis/record.test.ts
import { Hub } from '@aws-amplify/core'; import { record as pinpointRecord } from '@aws-amplify/core/internals/providers/pinpoint'; import { ConsoleLogger } from '@aws-amplify/core'; import { record } from '../../../../src/providers/pinpoint'; import { resolveConfig, resolveCredentials, } from '../../../../src/provid...
2,214
0
petrpan-code/aws-amplify/amplify-js/packages/analytics/__tests__/providers/pinpoint
petrpan-code/aws-amplify/amplify-js/packages/analytics/__tests__/providers/pinpoint/utils/resolveConfig.test.ts
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 import { Amplify } from '@aws-amplify/core'; import { resolveConfig } from '../../../../src/providers/pinpoint/utils'; describe('Analytics Pinpoint Provider Util: resolveConfig', () => { const pinpointConfig ...
2,215
0
petrpan-code/aws-amplify/amplify-js/packages/analytics/__tests__/providers/pinpoint
petrpan-code/aws-amplify/amplify-js/packages/analytics/__tests__/providers/pinpoint/utils/resolveCredentials.test.ts
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 import { fetchAuthSession } from '@aws-amplify/core'; import { AnalyticsError } from '../../../../src/errors'; import { resolveCredentials } from '../../../../src/providers/pinpoint/utils'; jest.mock('@aws-amp...
2,216
0
petrpan-code/aws-amplify/amplify-js/packages/analytics/__tests__
petrpan-code/aws-amplify/amplify-js/packages/analytics/__tests__/testUtils/mockConstants.test.ts
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 export const mockBufferConfig = { bufferSize: 10, flushSize: 5, flushInterval: 50, }; export const mockKinesisConfig = { ...mockBufferConfig, region: 'us-east-1', }; export const mockPersonalizeConfig = ...
2,217
0
petrpan-code/aws-amplify/amplify-js/packages/analytics/__tests__
petrpan-code/aws-amplify/amplify-js/packages/analytics/__tests__/utils/groupBy.test.ts
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 import { groupBy } from '../../src/utils'; describe('Generic groupBy util function', () => { type TestType = { x: number; y: string; z: boolean; }; const testData: TestType[] = [ { x: 1, y: '...
2,218
0
petrpan-code/aws-amplify/amplify-js/packages/analytics/__tests__
petrpan-code/aws-amplify/amplify-js/packages/analytics/__tests__/utils/resolveCredentials.test.ts
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 import { fetchAuthSession } from '@aws-amplify/core'; import { resolveCredentials } from '../../src/utils'; import { AnalyticsError } from '../../src'; jest.mock('@aws-amplify/core'); describe('Analytics Kines...
2,219
0
petrpan-code/aws-amplify/amplify-js/packages/analytics/__tests__
petrpan-code/aws-amplify/amplify-js/packages/analytics/__tests__/utils/statusHelpers.test.ts
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 import { enableAnalytics, disableAnalytics, isAnalyticsEnabled, } from '../../src/utils'; describe('Analytics Category Util: status utils', () => { it('should indicate that Analytics is enabled by default'...
2,220
0
petrpan-code/aws-amplify/amplify-js/packages/analytics/__tests__/utils
petrpan-code/aws-amplify/amplify-js/packages/analytics/__tests__/utils/eventBuffer/EventBuffer.test.ts
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 import { EventBuffer } from '../../../src/utils'; describe('EventBuffer', () => { type TestEvent = { id: string; timestamp: number; }; it('append events in order', done => { const result: TestEvent[]...
2,312
0
petrpan-code/aws-amplify/amplify-js/packages/api-graphql
petrpan-code/aws-amplify/amplify-js/packages/api-graphql/__tests__/APIClient.test.ts
import { SchemaModel, ModelIntrospectionSchema, } from '@aws-amplify/core/internals/utils'; import { normalizeMutationInput, flattenItems, generateSelectionSet, customSelectionSetToIR, } from '../src/internals/APIClient'; import config from './fixtures/modeled/amplifyconfiguration'; const modelIntroSchema = conf...
2,313
0
petrpan-code/aws-amplify/amplify-js/packages/api-graphql
petrpan-code/aws-amplify/amplify-js/packages/api-graphql/__tests__/AWSAppSyncRealTimeProvider.test.ts
import { Observable, Observer } from 'rxjs'; import { Reachability } from '@aws-amplify/core/internals/utils'; import { ConsoleLogger } from '@aws-amplify/core'; import { MESSAGE_TYPES } from '../src/Providers/constants'; import * as constants from '../src/Providers/constants'; import { delay, FakeWebSocketInterface...
2,314
0
petrpan-code/aws-amplify/amplify-js/packages/api-graphql
petrpan-code/aws-amplify/amplify-js/packages/api-graphql/__tests__/GraphQLAPI.test.ts
import * as raw from '../src'; import { graphql, cancel, isCancelError } from '../src/internals/v6'; import { Amplify } from 'aws-amplify'; import { Amplify as AmplifyCore } from '@aws-amplify/core'; import * as typedQueries from './fixtures/with-types/queries'; import { expectGet } from './utils/expects'; import { _...
2,315
0
petrpan-code/aws-amplify/amplify-js/packages/api-graphql
petrpan-code/aws-amplify/amplify-js/packages/api-graphql/__tests__/generateClient.test.ts
import * as raw from '../src'; import { Amplify, AmplifyClassV6 } from '@aws-amplify/core'; import { generateClient } from '../src/internals'; import configFixture from './fixtures/modeled/amplifyconfiguration'; import { Schema } from './fixtures/modeled/schema'; import { expectSub, expectSubWithHeaders, expectSubWi...
2,317
0
petrpan-code/aws-amplify/amplify-js/packages/api-graphql
petrpan-code/aws-amplify/amplify-js/packages/api-graphql/__tests__/resolveConfig.test.ts
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 import { resolveConfig } from '../src/utils'; import { GraphQLAuthMode } from '@aws-amplify/core/internals/utils'; import { AmplifyClassV6 } from '@aws-amplify/core'; describe('GraphQL API Util: resolveConfig'...
2,318
0
petrpan-code/aws-amplify/amplify-js/packages/api-graphql
petrpan-code/aws-amplify/amplify-js/packages/api-graphql/__tests__/resolveOwnerFields.test.ts
import { ModelIntrospectionSchema, SchemaModel, } from '@aws-amplify/core/dist/esm/singleton/API/types'; import { resolveOwnerFields } from '../src/utils/resolveOwnerFields'; import configFixture from './fixtures/modeled/amplifyconfiguration'; describe('owner field resolution', () => { const expectedResolutions = {...
2,319
0
petrpan-code/aws-amplify/amplify-js/packages/api-graphql
petrpan-code/aws-amplify/amplify-js/packages/api-graphql/__tests__/v6-test.ts
import * as raw from '../src'; import { graphql } from '../src/internals/v6'; import { Amplify } from 'aws-amplify'; import * as typedQueries from './fixtures/with-types/queries'; import * as typedMutations from './fixtures/with-types/mutations'; import * as typedSubscriptions from './fixtures/with-types/subscriptions'...
2,330
0
petrpan-code/aws-amplify/amplify-js/packages/api-graphql/__tests__
petrpan-code/aws-amplify/amplify-js/packages/api-graphql/__tests__/server/generateClient.test.ts
import * as raw from '../../src'; import { Amplify, ResourcesConfig } from '@aws-amplify/core'; import { generateClient } from '../../src/internals/server'; import configFixture from '../fixtures/modeled/amplifyconfiguration'; import { Schema } from '../fixtures/modeled/schema'; import { V6ClientSSRRequest, V6ClientSSR...