@rindo/core 2.16.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +27 -0
- package/bin/rindo +57 -0
- package/cli/index.cjs +1784 -0
- package/cli/index.d.ts +15 -0
- package/cli/index.js +1758 -0
- package/cli/package.json +14 -0
- package/compiler/lib.d.ts +24 -0
- package/compiler/lib.dom.d.ts +17791 -0
- package/compiler/lib.dom.iterable.d.ts +323 -0
- package/compiler/lib.es2015.collection.d.ts +89 -0
- package/compiler/lib.es2015.core.d.ts +559 -0
- package/compiler/lib.es2015.d.ts +30 -0
- package/compiler/lib.es2015.generator.d.ts +79 -0
- package/compiler/lib.es2015.iterable.d.ts +497 -0
- package/compiler/lib.es2015.promise.d.ts +78 -0
- package/compiler/lib.es2015.proxy.d.ts +41 -0
- package/compiler/lib.es2015.reflect.d.ts +123 -0
- package/compiler/lib.es2015.symbol.d.ts +48 -0
- package/compiler/lib.es2015.symbol.wellknown.d.ts +324 -0
- package/compiler/lib.es2016.array.include.d.ts +118 -0
- package/compiler/lib.es2016.d.ts +22 -0
- package/compiler/lib.es2016.full.d.ts +25 -0
- package/compiler/lib.es2017.d.ts +26 -0
- package/compiler/lib.es2017.full.d.ts +25 -0
- package/compiler/lib.es2017.intl.d.ts +32 -0
- package/compiler/lib.es2017.object.d.ts +51 -0
- package/compiler/lib.es2017.sharedmemory.d.ts +137 -0
- package/compiler/lib.es2017.string.d.ts +47 -0
- package/compiler/lib.es2017.typedarrays.d.ts +55 -0
- package/compiler/lib.es2018.asyncgenerator.d.ts +79 -0
- package/compiler/lib.es2018.asynciterable.d.ts +45 -0
- package/compiler/lib.es2018.d.ts +26 -0
- package/compiler/lib.es2018.full.d.ts +25 -0
- package/compiler/lib.es2018.intl.d.ts +73 -0
- package/compiler/lib.es2018.promise.d.ts +32 -0
- package/compiler/lib.es2018.regexp.d.ts +39 -0
- package/compiler/lib.es2019.array.d.ts +85 -0
- package/compiler/lib.es2019.d.ts +25 -0
- package/compiler/lib.es2019.full.d.ts +25 -0
- package/compiler/lib.es2019.object.d.ts +35 -0
- package/compiler/lib.es2019.string.d.ts +39 -0
- package/compiler/lib.es2019.symbol.d.ts +26 -0
- package/compiler/lib.es2020.bigint.d.ts +728 -0
- package/compiler/lib.es2020.d.ts +27 -0
- package/compiler/lib.es2020.full.d.ts +25 -0
- package/compiler/lib.es2020.intl.d.ts +368 -0
- package/compiler/lib.es2020.promise.d.ts +49 -0
- package/compiler/lib.es2020.sharedmemory.d.ts +99 -0
- package/compiler/lib.es2020.string.d.ts +30 -0
- package/compiler/lib.es2020.symbol.wellknown.d.ts +39 -0
- package/compiler/lib.es2021.d.ts +25 -0
- package/compiler/lib.es2021.full.d.ts +25 -0
- package/compiler/lib.es2021.intl.d.ts +44 -0
- package/compiler/lib.es2021.promise.d.ts +50 -0
- package/compiler/lib.es2021.string.d.ts +35 -0
- package/compiler/lib.es2021.weakref.d.ts +75 -0
- package/compiler/lib.es5.d.ts +4495 -0
- package/compiler/lib.es6.d.ts +25 -0
- package/compiler/lib.esnext.d.ts +22 -0
- package/compiler/lib.esnext.full.d.ts +25 -0
- package/compiler/lib.esnext.intl.d.ts +23 -0
- package/compiler/lib.esnext.promise.d.ts +43 -0
- package/compiler/lib.esnext.string.d.ts +35 -0
- package/compiler/lib.esnext.weakref.d.ts +75 -0
- package/compiler/lib.scripthost.d.ts +327 -0
- package/compiler/lib.webworker.d.ts +5733 -0
- package/compiler/lib.webworker.importscripts.d.ts +26 -0
- package/compiler/lib.webworker.iterable.d.ts +160 -0
- package/compiler/package.json +8 -0
- package/compiler/rindo.d.ts +95 -0
- package/compiler/rindo.js +67222 -0
- package/compiler/rindo.min.js +4 -0
- package/dependencies.json +109 -0
- package/dev-server/client/app-error.d.ts +18 -0
- package/dev-server/client/events.d.ts +6 -0
- package/dev-server/client/hmr-components.d.ts +1 -0
- package/dev-server/client/hmr-external-styles.d.ts +1 -0
- package/dev-server/client/hmr-images.d.ts +1 -0
- package/dev-server/client/hmr-inline-styles.d.ts +1 -0
- package/dev-server/client/hmr-util.d.ts +9 -0
- package/dev-server/client/hmr-window.d.ts +10 -0
- package/dev-server/client/index.d.ts +6 -0
- package/dev-server/client/index.js +808 -0
- package/dev-server/client/logger.d.ts +5 -0
- package/dev-server/client/package.json +8 -0
- package/dev-server/client/progress.d.ts +3 -0
- package/dev-server/client/status.d.ts +4 -0
- package/dev-server/connector.html +6 -0
- package/dev-server/index.d.ts +3 -0
- package/dev-server/index.js +264 -0
- package/dev-server/open-in-editor-api.js +1 -0
- package/dev-server/package.json +8 -0
- package/dev-server/server-process.js +1763 -0
- package/dev-server/server-worker-thread.js +39 -0
- package/dev-server/static/favicon.ico +0 -0
- package/dev-server/templates/directory-index.html +132 -0
- package/dev-server/templates/initial-load.html +160 -0
- package/dev-server/visualstudio.vbs +82 -0
- package/dev-server/ws.js +1 -0
- package/dev-server/xdg-open +1066 -0
- package/internal/app-data/index.cjs +92 -0
- package/internal/app-data/index.d.ts +4 -0
- package/internal/app-data/index.js +88 -0
- package/internal/app-data/package.json +15 -0
- package/internal/client/css-shim.js +4 -0
- package/internal/client/dom.js +73 -0
- package/internal/client/index.js +3059 -0
- package/internal/client/package.json +8 -0
- package/internal/client/patch-browser.js +124 -0
- package/internal/client/patch-esm.js +23 -0
- package/internal/client/polyfills/core-js.js +11 -0
- package/internal/client/polyfills/css-shim.js +1 -0
- package/internal/client/polyfills/dom.js +79 -0
- package/internal/client/polyfills/es5-html-element.js +1 -0
- package/internal/client/polyfills/index.js +34 -0
- package/internal/client/polyfills/system.js +6 -0
- package/internal/client/shadow-css.js +387 -0
- package/internal/hydrate/index.js +1132 -0
- package/internal/hydrate/package.json +7 -0
- package/internal/hydrate/runner.d.ts +217 -0
- package/internal/hydrate/runner.js +777 -0
- package/internal/hydrate/shadow-css.js +143 -0
- package/internal/index.d.ts +4 -0
- package/internal/index.js +2 -0
- package/internal/package.json +9 -0
- package/internal/rindo-core/index.cjs +1 -0
- package/internal/rindo-core/index.d.ts +52 -0
- package/internal/rindo-core/index.js +16 -0
- package/internal/rindo-ext-modules.d.ts +41 -0
- package/internal/rindo-private.d.ts +2289 -0
- package/internal/rindo-public-compiler.d.ts +2273 -0
- package/internal/rindo-public-docs.d.ts +116 -0
- package/internal/rindo-public-runtime.d.ts +1565 -0
- package/internal/testing/index.js +1093 -0
- package/internal/testing/package.json +7 -0
- package/internal/testing/shadow-css.js +143 -0
- package/mock-doc/index.cjs +4658 -0
- package/mock-doc/index.d.ts +928 -0
- package/mock-doc/index.js +4622 -0
- package/mock-doc/package.json +15 -0
- package/package.json +151 -0
- package/readme.md +74 -0
- package/screenshot/compare/assets/favicon.ico +0 -0
- package/screenshot/compare/assets/logo.png +0 -0
- package/screenshot/compare/build/app.css +1 -0
- package/screenshot/compare/build/app.esm.js +1 -0
- package/screenshot/compare/build/app.js +33 -0
- package/screenshot/compare/build/index.esm.js +0 -0
- package/screenshot/compare/build/p-081b0641.js +1 -0
- package/screenshot/compare/build/p-227a1e18.entry.js +1 -0
- package/screenshot/compare/build/p-2c298727.entry.js +1 -0
- package/screenshot/compare/build/p-5479268c.entry.js +1 -0
- package/screenshot/compare/build/p-573ec8a4.entry.js +1 -0
- package/screenshot/compare/build/p-6ba08604.entry.js +1 -0
- package/screenshot/compare/build/p-6bc63295.entry.js +1 -0
- package/screenshot/compare/build/p-7a3759fd.entry.js +1 -0
- package/screenshot/compare/build/p-7b4e3ba7.js +1 -0
- package/screenshot/compare/build/p-988eb362.css +1 -0
- package/screenshot/compare/build/p-9b6a9315.js +1 -0
- package/screenshot/compare/build/p-b4cc611c.entry.js +1 -0
- package/screenshot/compare/build/p-d1bf53f5.entry.js +1 -0
- package/screenshot/compare/build/p-e2efe0df.js +1 -0
- package/screenshot/compare/build/p-e8ca6d97.entry.js +1 -0
- package/screenshot/compare/build/p-ec2f13e0.entry.js +1 -0
- package/screenshot/compare/build/p-f0b99977.entry.js +1 -0
- package/screenshot/compare/build/p-f4745c2f.entry.js +1 -0
- package/screenshot/compare/build/p-fbbae598.js +1 -0
- package/screenshot/compare/host.config.json +15 -0
- package/screenshot/compare/index.html +1 -0
- package/screenshot/compare/manifest.json +13 -0
- package/screenshot/connector-base.d.ts +42 -0
- package/screenshot/connector-local.d.ts +7 -0
- package/screenshot/connector.js +2 -0
- package/screenshot/index.d.ts +3 -0
- package/screenshot/index.js +659 -0
- package/screenshot/local-connector.js +2 -0
- package/screenshot/package.json +15 -0
- package/screenshot/pixel-match.d.ts +1 -0
- package/screenshot/pixel-match.js +2673 -0
- package/screenshot/screenshot-compare.d.ts +3 -0
- package/screenshot/screenshot-fs.d.ts +15 -0
- package/sys/node/autoprefixer.js +8 -0
- package/sys/node/glob.js +1 -0
- package/sys/node/graceful-fs.js +1 -0
- package/sys/node/index.d.ts +18 -0
- package/sys/node/index.js +6124 -0
- package/sys/node/node-fetch.js +1 -0
- package/sys/node/package.json +8 -0
- package/sys/node/prompts.js +1 -0
- package/sys/node/worker.js +52 -0
- package/testing/index.d.ts +12 -0
- package/testing/index.js +4232 -0
- package/testing/jest/jest-config.d.ts +16 -0
- package/testing/jest/jest-environment.d.ts +15 -0
- package/testing/jest/jest-preprocessor.d.ts +59 -0
- package/testing/jest/jest-runner.d.ts +9 -0
- package/testing/jest/jest-screenshot.d.ts +2 -0
- package/testing/jest/jest-serializer.d.ts +5 -0
- package/testing/jest/jest-setup-test-framework.d.ts +1 -0
- package/testing/jest-environment.js +3 -0
- package/testing/jest-preprocessor.js +3 -0
- package/testing/jest-preset.js +37 -0
- package/testing/jest-runner.js +3 -0
- package/testing/jest-setuptestframework.js +3 -0
- package/testing/matchers/attributes.d.ts +14 -0
- package/testing/matchers/class-list.d.ts +12 -0
- package/testing/matchers/events.d.ts +21 -0
- package/testing/matchers/html.d.ts +12 -0
- package/testing/matchers/index.d.ts +23 -0
- package/testing/matchers/screenshot.d.ts +5 -0
- package/testing/matchers/text.d.ts +4 -0
- package/testing/mock-fetch.d.ts +11 -0
- package/testing/mocks.d.ts +10 -0
- package/testing/package.json +8 -0
- package/testing/puppeteer/index.d.ts +2 -0
- package/testing/puppeteer/puppeteer-browser.d.ts +6 -0
- package/testing/puppeteer/puppeteer-declarations.d.ts +429 -0
- package/testing/puppeteer/puppeteer-element.d.ts +67 -0
- package/testing/puppeteer/puppeteer-emulate.d.ts +2 -0
- package/testing/puppeteer/puppeteer-events.d.ts +21 -0
- package/testing/puppeteer/puppeteer-page.d.ts +2 -0
- package/testing/puppeteer/puppeteer-screenshot.d.ts +4 -0
- package/testing/reset-build-conditionals.d.ts +2 -0
- package/testing/spec-page.d.ts +2 -0
- package/testing/test-transpile.d.ts +2 -0
- package/testing/testing-logger.d.ts +25 -0
- package/testing/testing-sys.d.ts +6 -0
- package/testing/testing-utils.d.ts +6 -0
- package/testing/testing.d.ts +2 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type * as d from '@rindo/core/internal';
|
|
2
|
+
import type { Config } from '@jest/types';
|
|
3
|
+
/**
|
|
4
|
+
* Builds the `argv` to be used when programmatically invoking the Jest CLI
|
|
5
|
+
* @param config the Rindo config to use while generating Jest CLI arguments
|
|
6
|
+
* @returns the arguments to pass to the Jest CLI, wrapped in an object
|
|
7
|
+
*/
|
|
8
|
+
export declare function buildJestArgv(config: d.Config): Config.Argv;
|
|
9
|
+
/**
|
|
10
|
+
* Generate a Jest run configuration to be used as a part of the `argv` passed to the Jest CLI when it is invoked
|
|
11
|
+
* programmatically
|
|
12
|
+
* @param config the Rindo config to use while generating Jest CLI arguments
|
|
13
|
+
* @returns the Jest Config to attach to the `argv` argument
|
|
14
|
+
*/
|
|
15
|
+
export declare function buildJestConfig(config: d.Config): string;
|
|
16
|
+
export declare function getProjectListFromCLIArgs(config: d.Config, argv: Config.Argv): Config.Path[];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { JestEnvironmentGlobal } from '@rindo/core/internal';
|
|
2
|
+
export declare function createJestPuppeteerEnvironment(): {
|
|
3
|
+
new (config: any): {
|
|
4
|
+
[x: string]: any;
|
|
5
|
+
global: JestEnvironmentGlobal;
|
|
6
|
+
browser: any;
|
|
7
|
+
pages: any[];
|
|
8
|
+
setup(): Promise<void>;
|
|
9
|
+
newPuppeteerPage(): Promise<import("puppeteer").Page>;
|
|
10
|
+
closeOpenPages(): Promise<void>;
|
|
11
|
+
teardown(): Promise<void>;
|
|
12
|
+
getVmContext(): any;
|
|
13
|
+
};
|
|
14
|
+
[x: string]: any;
|
|
15
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
declare type Jest26CacheKeyOptions = {
|
|
2
|
+
instrument: boolean;
|
|
3
|
+
rootDir: string;
|
|
4
|
+
};
|
|
5
|
+
declare type Jest26Config = {
|
|
6
|
+
instrument: boolean;
|
|
7
|
+
rootDir: string;
|
|
8
|
+
};
|
|
9
|
+
declare type Jest27TransformOptions = {
|
|
10
|
+
config: Jest26Config;
|
|
11
|
+
};
|
|
12
|
+
export declare const jestPreprocessor: {
|
|
13
|
+
/**
|
|
14
|
+
* Transforms a file to CommonJS to be used by Jest. The API for `process` is described in the
|
|
15
|
+
* ["Writing custom transformers"](https://jestjs.io/docs/code-transformation#writing-custom-transformers)
|
|
16
|
+
* documentation on the jest site. Unfortunately, the URL is not versioned at the time of this writing. For
|
|
17
|
+
* reference, the v27.2 docs were referenced (the most recent available).
|
|
18
|
+
*
|
|
19
|
+
* This function attempts to support several versions of Jest (v23 through v27). Support for earlier versions of Jest
|
|
20
|
+
* will be removed in a future major version of Rindo.
|
|
21
|
+
*
|
|
22
|
+
* @param sourceText the contents of the source file
|
|
23
|
+
* @param sourcePath the path to the source file
|
|
24
|
+
* @param jestConfig the jest configuration when called by Jest 26 and lower. This parameter is folded into
|
|
25
|
+
* `transformOptions` when called by Jest 27+ as a top level `config` property. Calls to this function from Jest 27+
|
|
26
|
+
* will have a `Jest27TransformOptions` shape
|
|
27
|
+
* @param transformOptions an object containing the various transformation options. In Jest 27+ this parameter occurs
|
|
28
|
+
* third in this function signature (and no fourth parameter is formally accepted)
|
|
29
|
+
* @returns the transformed file contents if the file should be transformed. returns the original source otherwise
|
|
30
|
+
*/
|
|
31
|
+
process(sourceText: string, sourcePath: string, jestConfig: Jest26Config | Jest27TransformOptions, transformOptions?: Jest26Config): string;
|
|
32
|
+
/**
|
|
33
|
+
* Generates a key used to cache the results of transforming a file. This helps avoid re-processing a file via the
|
|
34
|
+
* `transform` function unnecessarily (when no changes have occurred). The API for `getCacheKey` is described in the
|
|
35
|
+
* ["Writing custom transformers"](https://jestjs.io/docs/code-transformation#writing-custom-transformers)
|
|
36
|
+
* documentation on the jest site. Unfortunately, the URL is not versioned at the time of this writing. For
|
|
37
|
+
* reference, the v27.2 docs were referenced (the most recent available).
|
|
38
|
+
*
|
|
39
|
+
* This function attempts to support several versions of Jest (v23 through v27). Support for earlier versions of Jest
|
|
40
|
+
* will be removed in a future major version of Rindo.
|
|
41
|
+
*
|
|
42
|
+
* @param sourceText the contents of the source file
|
|
43
|
+
* @param sourcePath the path to the source file
|
|
44
|
+
* @param jestConfigStr a stringified version of the jest configuration when called by Jest 26 and lower. This
|
|
45
|
+
* parameter takes the shape of `transformOptions` when called by Jest 27+.
|
|
46
|
+
* @param transformOptions an object containing the various transformation options. In Jest 27+ this parameter occurs
|
|
47
|
+
* third in this function signature (and no fourth parameter is formally accepted)
|
|
48
|
+
* @returns the key to cache a file with
|
|
49
|
+
*/
|
|
50
|
+
getCacheKey(sourceText: string, sourcePath: string, jestConfigStr: string | Jest27TransformOptions, transformOptions?: Jest26CacheKeyOptions): string;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Determines if a file should be transformed prior to being consumed by Jest, based on the file name and its contents
|
|
54
|
+
* @param filePath the path of the file
|
|
55
|
+
* @param sourceText the contents of the file
|
|
56
|
+
* @returns `true` if the file should be transformed, `false` otherwise
|
|
57
|
+
*/
|
|
58
|
+
export declare function shouldTransform(filePath: string, sourceText: string): boolean;
|
|
59
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type * as d from '@rindo/core/internal';
|
|
2
|
+
export declare function runJest(config: d.Config, env: d.E2EProcessEnv): Promise<boolean>;
|
|
3
|
+
/**
|
|
4
|
+
* Creates a Rindo test runner
|
|
5
|
+
* @returns the test runner
|
|
6
|
+
*/
|
|
7
|
+
export declare function createTestRunner(): any;
|
|
8
|
+
export declare function includeTestFile(testPath: string, env: d.E2EProcessEnv): boolean;
|
|
9
|
+
export declare function getEmulateConfigs(testing: d.TestingConfig, flags: d.ConfigFlags): d.EmulateConfig[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function jestSetupTestFramework(): void;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The path's declared below are relative. Specifically, they are relative to the location of this file after
|
|
3
|
+
* compilation of the Rindo compiler has completed. See `scripts/bundles/testing` for the location of this file
|
|
4
|
+
* following compilation.
|
|
5
|
+
*/
|
|
6
|
+
const path = require('path');
|
|
7
|
+
const testingDir = __dirname;
|
|
8
|
+
const rootDir = path.join(testingDir, '..');
|
|
9
|
+
const internalDir = path.join(rootDir, 'internal');
|
|
10
|
+
|
|
11
|
+
// NOTE: if you change this, also change compiler/transpile.ts
|
|
12
|
+
const moduleExtensions = ['ts', 'tsx', 'js', 'mjs', 'jsx'];
|
|
13
|
+
const moduleExtensionRegexp = '(' + moduleExtensions.join('|') + ')';
|
|
14
|
+
|
|
15
|
+
module.exports = {
|
|
16
|
+
moduleFileExtensions: [...moduleExtensions, 'json', 'd.ts'],
|
|
17
|
+
moduleNameMapper: {
|
|
18
|
+
'^@rindo/core/cli$': path.join(rootDir, 'cli', 'index.js'),
|
|
19
|
+
'^@rindo/core/compiler$': path.join(rootDir, 'compiler', 'rindo.js'),
|
|
20
|
+
'^@rindo/core/internal$': path.join(internalDir, 'testing', 'index.js'),
|
|
21
|
+
'^@rindo/core/internal/app-data$': path.join(internalDir, 'app-data', 'index.cjs'),
|
|
22
|
+
'^@rindo/core/internal/app-globals$': path.join(internalDir, 'app-globals', 'index.js'),
|
|
23
|
+
'^@rindo/core/internal/testing$': path.join(internalDir, 'testing', 'index.js'),
|
|
24
|
+
'^@rindo/core/mock-doc$': path.join(rootDir, 'mock-doc', 'index.cjs'),
|
|
25
|
+
'^@rindo/core/sys$': path.join(rootDir, 'sys', 'node', 'index.js'),
|
|
26
|
+
'^@rindo/core/testing$': path.join(testingDir, 'index.js'),
|
|
27
|
+
'^@rindo/core$': path.join(internalDir, 'testing', 'index.js'),
|
|
28
|
+
},
|
|
29
|
+
setupFilesAfterEnv: [path.join(testingDir, 'jest-setuptestframework.js')],
|
|
30
|
+
testEnvironment: path.join(testingDir, 'jest-environment.js'),
|
|
31
|
+
testPathIgnorePatterns: ['/.cache', '/.rindo', '/.vscode', '/dist', '/node_modules', '/www'],
|
|
32
|
+
testRegex: '(/__tests__/.*|\\.?(test|spec))\\.' + moduleExtensionRegexp + '$',
|
|
33
|
+
transform: {
|
|
34
|
+
'^.+\\.(ts|tsx|jsx|css)$': path.join(testingDir, 'jest-preprocessor.js'),
|
|
35
|
+
},
|
|
36
|
+
watchPathIgnorePatterns: ['^.+\\.d\\.ts$'],
|
|
37
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare function toEqualAttribute(elm: HTMLElement, expectAttrName: string, expectAttrValue: string): {
|
|
2
|
+
message: () => string;
|
|
3
|
+
pass: boolean;
|
|
4
|
+
};
|
|
5
|
+
export declare function toEqualAttributes(elm: HTMLElement, expectAttrs: {
|
|
6
|
+
[attrName: string]: any;
|
|
7
|
+
}): {
|
|
8
|
+
message: () => string;
|
|
9
|
+
pass: boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare function toHaveAttribute(elm: HTMLElement, expectAttrName: string): {
|
|
12
|
+
message: () => string;
|
|
13
|
+
pass: boolean;
|
|
14
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare function toHaveClass(elm: HTMLElement, expectClassName: string): {
|
|
2
|
+
message: () => string;
|
|
3
|
+
pass: boolean;
|
|
4
|
+
};
|
|
5
|
+
export declare function toHaveClasses(elm: HTMLElement, expectClassNames: string[]): {
|
|
6
|
+
message: () => string;
|
|
7
|
+
pass: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare function toMatchClasses(elm: HTMLElement, expectClassNames: string[]): {
|
|
10
|
+
message: () => string;
|
|
11
|
+
pass: boolean;
|
|
12
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type * as d from '@rindo/core/internal';
|
|
2
|
+
export declare function toHaveReceivedEvent(eventSpy: d.EventSpy): {
|
|
3
|
+
message: () => string;
|
|
4
|
+
pass: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare function toHaveReceivedEventTimes(eventSpy: d.EventSpy, count: number): {
|
|
7
|
+
message: () => string;
|
|
8
|
+
pass: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare function toHaveReceivedEventDetail(eventSpy: d.EventSpy, eventDetail: any): {
|
|
11
|
+
message: () => string;
|
|
12
|
+
pass: boolean;
|
|
13
|
+
};
|
|
14
|
+
export declare function toHaveFirstReceivedEventDetail(eventSpy: d.EventSpy, eventDetail: any): {
|
|
15
|
+
message: () => string;
|
|
16
|
+
pass: boolean;
|
|
17
|
+
};
|
|
18
|
+
export declare function toHaveNthReceivedEventDetail(eventSpy: d.EventSpy, index: number, eventDetail: any): {
|
|
19
|
+
message: () => string;
|
|
20
|
+
pass: boolean;
|
|
21
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare function toEqualHtml(input: string | HTMLElement | ShadowRoot, shouldEqual: string): {
|
|
2
|
+
message: () => string;
|
|
3
|
+
pass: boolean;
|
|
4
|
+
};
|
|
5
|
+
export declare function toEqualLightHtml(input: string | HTMLElement | ShadowRoot, shouldEqual: string): {
|
|
6
|
+
message: () => string;
|
|
7
|
+
pass: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare function compareHtml(input: string | HTMLElement | ShadowRoot, shouldEqual: string, serializeShadowRoot: boolean): {
|
|
10
|
+
message: () => string;
|
|
11
|
+
pass: boolean;
|
|
12
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { toEqualAttribute, toEqualAttributes, toHaveAttribute } from './attributes';
|
|
2
|
+
import { toHaveReceivedEvent, toHaveReceivedEventDetail, toHaveReceivedEventTimes, toHaveFirstReceivedEventDetail, toHaveNthReceivedEventDetail } from './events';
|
|
3
|
+
import { toEqualHtml, toEqualLightHtml } from './html';
|
|
4
|
+
import { toEqualText } from './text';
|
|
5
|
+
import { toHaveClass, toHaveClasses, toMatchClasses } from './class-list';
|
|
6
|
+
import { toMatchScreenshot } from './screenshot';
|
|
7
|
+
export declare const expectExtend: {
|
|
8
|
+
toEqualAttribute: typeof toEqualAttribute;
|
|
9
|
+
toEqualAttributes: typeof toEqualAttributes;
|
|
10
|
+
toEqualHtml: typeof toEqualHtml;
|
|
11
|
+
toEqualLightHtml: typeof toEqualLightHtml;
|
|
12
|
+
toEqualText: typeof toEqualText;
|
|
13
|
+
toHaveAttribute: typeof toHaveAttribute;
|
|
14
|
+
toHaveClass: typeof toHaveClass;
|
|
15
|
+
toHaveClasses: typeof toHaveClasses;
|
|
16
|
+
toMatchClasses: typeof toMatchClasses;
|
|
17
|
+
toHaveReceivedEvent: typeof toHaveReceivedEvent;
|
|
18
|
+
toHaveReceivedEventDetail: typeof toHaveReceivedEventDetail;
|
|
19
|
+
toHaveReceivedEventTimes: typeof toHaveReceivedEventTimes;
|
|
20
|
+
toHaveFirstReceivedEventDetail: typeof toHaveFirstReceivedEventDetail;
|
|
21
|
+
toHaveNthReceivedEventDetail: typeof toHaveNthReceivedEventDetail;
|
|
22
|
+
toMatchScreenshot: typeof toMatchScreenshot;
|
|
23
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { MockResponse } from '../mock-doc';
|
|
2
|
+
export declare function setupMockFetch(global: any): void;
|
|
3
|
+
export declare function mockFetchReset(): void;
|
|
4
|
+
export declare const mockFetch: {
|
|
5
|
+
json(data: any, url?: string): void;
|
|
6
|
+
text(data: string, url?: string): void;
|
|
7
|
+
response(rsp: MockResponse, url?: string): void;
|
|
8
|
+
reject(rsp?: MockResponse, url?: string): void;
|
|
9
|
+
reset: typeof mockFetchReset;
|
|
10
|
+
};
|
|
11
|
+
export { MockHeaders, MockRequest, MockRequestInit, MockRequestInfo, MockResponse, MockResponseInit, } from '../mock-doc';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { BuildCtx, Cache, CompilerCtx, CompilerSystem, Config } from '@rindo/core/internal';
|
|
2
|
+
import { TestingLogger } from './testing-logger';
|
|
3
|
+
export declare function mockConfig(sys?: CompilerSystem): Config;
|
|
4
|
+
export declare function mockCompilerCtx(config?: Config): CompilerCtx;
|
|
5
|
+
export declare function mockBuildCtx(config?: Config, compilerCtx?: CompilerCtx): BuildCtx;
|
|
6
|
+
export declare function mockCache(config?: Config, compilerCtx?: CompilerCtx): Cache;
|
|
7
|
+
export declare function mockLogger(): TestingLogger;
|
|
8
|
+
export declare function mockRindoSystem(): CompilerSystem;
|
|
9
|
+
export declare function mockDocument(html?: string): Document;
|
|
10
|
+
export declare function mockWindow(html?: string): Window;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Config } from '@rindo/core/internal';
|
|
2
|
+
import type * as puppeteer from 'puppeteer';
|
|
3
|
+
export declare function startPuppeteerBrowser(config: Config): Promise<puppeteer.Browser>;
|
|
4
|
+
export declare function connectBrowser(): Promise<any>;
|
|
5
|
+
export declare function disconnectBrowser(browser: puppeteer.Browser): Promise<void>;
|
|
6
|
+
export declare function newBrowserPage(browser: puppeteer.Browser): Promise<puppeteer.Page>;
|