@midwayjs/mock 3.5.3 → 3.6.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.
@@ -1,4 +1,5 @@
1
1
  /// <reference types="node" />
2
+ /// <reference types="node" />
2
3
  import * as WebSocket from 'ws';
3
4
  import * as http from 'http';
4
5
  import * as url from 'url';
package/dist/creator.js CHANGED
@@ -4,7 +4,6 @@ exports.createBootstrap = exports.createLightApp = exports.createFunctionApp = e
4
4
  const core_1 = require("@midwayjs/core");
5
5
  const path_1 = require("path");
6
6
  const fs_extra_1 = require("fs-extra");
7
- const decorator_1 = require("@midwayjs/decorator");
8
7
  const logger_1 = require("@midwayjs/logger");
9
8
  const utils_1 = require("./utils");
10
9
  const util_1 = require("util");
@@ -83,7 +82,7 @@ async function create(appDir = process.cwd(), options, customFramework) {
83
82
  const originMethod = container.listModule;
84
83
  container.listModule = key => {
85
84
  const modules = originMethod.call(container, key);
86
- if (key === decorator_1.CONFIGURATION_KEY) {
85
+ if (key === core_1.CONFIGURATION_KEY) {
87
86
  return modules;
88
87
  }
89
88
  return modules.filter((module) => {
@@ -139,10 +138,10 @@ async function close(app, options) {
139
138
  }
140
139
  }
141
140
  if (options.sleep > 0) {
142
- await (0, decorator_1.sleep)(options.sleep);
141
+ await (0, core_1.sleep)(options.sleep);
143
142
  }
144
143
  else {
145
- await (0, decorator_1.sleep)(50);
144
+ await (0, core_1.sleep)(50);
146
145
  }
147
146
  }
148
147
  }
@@ -309,10 +308,10 @@ class BootstrapAppStarter {
309
308
  await BootstrapModule.Bootstrap.stop();
310
309
  }
311
310
  if (options.sleep > 0) {
312
- await (0, decorator_1.sleep)(options.sleep);
311
+ await (0, core_1.sleep)(options.sleep);
313
312
  }
314
313
  else {
315
- await (0, decorator_1.sleep)(50);
314
+ await (0, core_1.sleep)(50);
316
315
  }
317
316
  }
318
317
  }
@@ -323,7 +322,7 @@ class BootstrapAppStarter {
323
322
  */
324
323
  async function createLightApp(baseDir = '', options = {}) {
325
324
  var _a;
326
- (0, decorator_1.Framework)()(LightFramework);
325
+ (0, core_1.Framework)()(LightFramework);
327
326
  options.globalConfig = Object.assign({
328
327
  midwayLogger: {
329
328
  default: {
package/dist/utils.js CHANGED
@@ -8,7 +8,6 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.transformFrameworkToConfiguration = exports.findFirstExistModule = exports.isWin32 = exports.isTestEnvironment = void 0;
10
10
  const core_1 = require("@midwayjs/core");
11
- const decorator_1 = require("@midwayjs/decorator");
12
11
  const os = require("os");
13
12
  const assert = require("assert");
14
13
  function isTestEnvironment() {
@@ -63,7 +62,7 @@ function transformFrameworkToConfiguration(Framework) {
63
62
  }
64
63
  };
65
64
  CustomConfiguration = __decorate([
66
- (0, decorator_1.Configuration)()
65
+ (0, core_1.Configuration)()
67
66
  ], CustomConfiguration);
68
67
  return {
69
68
  Configuration: CustomConfiguration,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midwayjs/mock",
3
- "version": "3.5.3",
3
+ "version": "3.6.0",
4
4
  "description": "create your test app from midway framework",
5
5
  "main": "dist/index",
6
6
  "typings": "dist/index.d.ts",
@@ -27,8 +27,7 @@
27
27
  },
28
28
  "license": "MIT",
29
29
  "devDependencies": {
30
- "@midwayjs/core": "^3.5.3",
31
- "@midwayjs/decorator": "^3.4.11",
30
+ "@midwayjs/core": "^3.6.0",
32
31
  "@midwayjs/logger": "^2.15.0",
33
32
  "@types/amqplib": "0.8.2",
34
33
  "amqplib": "0.10.3",
@@ -38,7 +37,7 @@
38
37
  "ws": "8.9.0"
39
38
  },
40
39
  "dependencies": {
41
- "@midwayjs/async-hooks-context-manager": "^3.5.3",
40
+ "@midwayjs/async-hooks-context-manager": "^3.6.0",
42
41
  "@types/superagent": "4.1.14",
43
42
  "@types/supertest": "2.0.12",
44
43
  "fs-extra": "10.0.1",
@@ -51,5 +50,5 @@
51
50
  "type": "git",
52
51
  "url": "http://github.com/midwayjs/midway.git"
53
52
  },
54
- "gitHead": "32356484664846984f6d3d65a3a75dea015e8dcc"
53
+ "gitHead": "22643b0e8519766bb7c68b975930199fc136336e"
55
54
  }