Skip to content
This repository was archived by the owner on Nov 9, 2023. It is now read-only.

Commit 42b7f06

Browse files
committed
Add duplex engine stream
1 parent 522d8f3 commit 42b7f06

File tree

9 files changed

+368
-237
lines changed

9 files changed

+368
-237
lines changed

jest.config.js

Lines changed: 4 additions & 163 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,7 @@
22
* For a detailed explanation regarding each configuration property and type check, visit:
33
* https://jestjs.io/docs/configuration
44
*/
5-
65
module.exports = {
7-
// All imported modules in your tests should be mocked automatically
8-
// automock: false,
9-
10-
// Stop running tests after `n` failures
11-
// bail: 0,
12-
13-
// The directory where Jest should store its cached dependency information
14-
// cacheDirectory: "/private/var/folders/fk/c3y07g0576j8_2s9m01pk4qw0000gn/T/jest_dx",
15-
16-
// Automatically clear mock calls, instances and results before every test.
17-
// This does not remove any mock implementation that may have been provided,
18-
// so we disable it.
19-
// clearMocks: true,
20-
216
// Indicates whether the coverage information should be collected while executing the test
227
collectCoverage: true,
238

@@ -27,11 +12,6 @@ module.exports = {
2712
// The directory where Jest should output its coverage files
2813
coverageDirectory: 'coverage',
2914

30-
// An array of regexp pattern strings used to skip coverage collection
31-
// coveragePathIgnorePatterns: [
32-
// "/node_modules/"
33-
// ],
34-
3515
// Indicates which provider should be used to instrument code for coverage
3616
coverageProvider: 'v8',
3717

@@ -41,164 +21,25 @@ module.exports = {
4121
// An object that configures minimum threshold enforcement for coverage results
4222
coverageThreshold: {
4323
global: {
44-
branches: 69.23,
45-
functions: 88.88,
46-
lines: 93.75,
47-
statements: 93.75,
24+
branches: 81.81,
25+
functions: 89.47,
26+
lines: 96.64,
27+
statements: 96.64,
4828
},
4929
},
5030

51-
// A path to a custom dependency extractor
52-
// dependencyExtractor: undefined,
53-
54-
// Make calling deprecated APIs throw helpful error messages
55-
// errorOnDeprecated: false,
56-
57-
// Force coverage collection from ignored files using an array of glob patterns
58-
// forceCoverageMatch: [],
59-
60-
// A path to a module which exports an async function that is triggered once before all test suites
61-
// globalSetup: undefined,
62-
63-
// A path to a module which exports an async function that is triggered once after all test suites
64-
// globalTeardown: undefined,
65-
66-
// A set of global variables that need to be available in all test environments
67-
// globals: {},
68-
69-
// The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers.
70-
// maxWorkers: "50%",
71-
72-
// An array of directory names to be searched recursively up from the requiring module's location
73-
// moduleDirectories: [
74-
// "node_modules"
75-
// ],
76-
77-
// An array of file extensions your modules use
78-
// moduleFileExtensions: [
79-
// "js",
80-
// "jsx",
81-
// "ts",
82-
// "tsx",
83-
// "json",
84-
// "node"
85-
// ],
86-
87-
// A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
88-
// moduleNameMapper: {},
89-
90-
// An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
91-
// modulePathIgnorePatterns: [],
92-
93-
// Activates notifications for test results
94-
// notify: false,
95-
96-
// An enum that specifies notification mode. Requires { notify: true }
97-
// notifyMode: "failure-change",
98-
9931
// A preset that is used as a base for Jest's configuration
10032
preset: 'ts-jest',
10133

102-
// Run tests from one or more projects
103-
// projects: undefined,
104-
105-
// Use this configuration option to add custom reporters to Jest
106-
// reporters: undefined,
107-
10834
// "resetMocks" resets all mocks, including mocked modules, to jest.fn(),
10935
// between each test case.
11036
resetMocks: true,
11137

112-
// Reset the module registry before running each individual test
113-
// resetModules: false,
114-
115-
// A path to a custom resolver
116-
// resolver: undefined,
117-
11838
// "restoreMocks" restores all mocks created using jest.spyOn to their
11939
// original implementations, between each test. It does not affect mocked
12040
// modules.
12141
restoreMocks: true,
12242

123-
// The root directory that Jest should scan for tests and modules within
124-
// rootDir: undefined,
125-
126-
// A list of paths to directories that Jest should use to search for files in
127-
// roots: [
128-
// "<rootDir>"
129-
// ],
130-
131-
// Allows you to use a custom runner instead of Jest's default test runner
132-
// runner: "jest-runner",
133-
134-
// The paths to modules that run some code to configure or set up the testing environment before each test
135-
// setupFiles: [],
136-
137-
// A list of paths to modules that run some code to configure or set up the testing framework before each test
138-
// setupFilesAfterEnv: [],
139-
140-
// The number of seconds after which a test is considered as slow and reported as such in the results.
141-
// slowTestThreshold: 5,
142-
143-
// A list of paths to snapshot serializer modules Jest should use for snapshot testing
144-
// snapshotSerializers: [],
145-
146-
// The test environment that will be used for testing
147-
// testEnvironment: "jest-environment-node",
148-
149-
// Options that will be passed to the testEnvironment
150-
// testEnvironmentOptions: {},
151-
152-
// Adds a location field to test results
153-
// testLocationInResults: false,
154-
155-
// The glob patterns Jest uses to detect test files
156-
// testMatch: [
157-
// "**/__tests__/**/*.[jt]s?(x)",
158-
// "**/?(*.)+(spec|test).[tj]s?(x)"
159-
// ],
160-
161-
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
162-
// testPathIgnorePatterns: [
163-
// "/node_modules/"
164-
// ],
165-
166-
// The regexp pattern or array of patterns that Jest uses to detect test files
167-
// testRegex: [],
168-
169-
// This option allows the use of a custom results processor
170-
// testResultsProcessor: undefined,
171-
172-
// This option allows use of a custom test runner
173-
// testRunner: "jest-circus/runner",
174-
17543
// Reduce the default test timeout from 5s to 2.5s
17644
testTimeout: 2500,
177-
178-
// This option sets the URL for the jsdom environment. It is reflected in properties such as location.href
179-
// testURL: "http://localhost",
180-
181-
// Setting this value to "fake" allows the use of fake timers for functions such as "setTimeout"
182-
// timers: "real",
183-
184-
// A map from regular expressions to paths to transformers
185-
// transform: undefined,
186-
187-
// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
188-
// transformIgnorePatterns: [
189-
// "/node_modules/",
190-
// "\\.pnp\\.[^\\/]+$"
191-
// ],
192-
193-
// An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them
194-
// unmockedModulePathPatterns: undefined,
195-
196-
// Indicates whether each individual test should be reported during the run
197-
// verbose: undefined,
198-
199-
// An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode
200-
// watchPathIgnorePatterns: [],
201-
202-
// Whether to use watchman for file crawling
203-
// watchman: true,
20445
};

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"test:watch": "jest --watch"
2525
},
2626
"dependencies": {
27-
"@metamask/safe-event-emitter": "^2.0.0",
27+
"@metamask/utils": "^2.1.0",
2828
"readable-stream": "^2.3.3"
2929
},
3030
"devDependencies": {
@@ -48,7 +48,7 @@
4848
"eslint-plugin-prettier": "^3.3.1",
4949
"jest": "^27.5.1",
5050
"jest-it-up": "^2.0.2",
51-
"json-rpc-engine": "^6.1.0",
51+
"json-rpc-engine": "./json-rpc-engine-6.1.2.tgz",
5252
"prettier": "^2.2.1",
5353
"prettier-plugin-packagejson": "^2.2.17",
5454
"rimraf": "^3.0.2",

0 commit comments

Comments
 (0)