@onehat/events 1.6.4 → 1.6.6
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/cypress/plugins/index.js +35 -0
- package/cypress/support/e2e.js +2 -0
- package/cypress.config.js +13 -0
- package/package.json +13 -13
- package/src/EventEmitter.js +1 -2
- /package/cypress/{cypress.json → disabled/cypress/cypress.json} +0 -0
- /package/cypress/{plugins → disabled/cypress/plugins}/index.cjs +0 -0
- /package/cypress/{support → disabled/cypress/support}/index.js +0 -0
- /package/{cypress.json → cypress/disabled/cypress.json} +0 -0
- /package/cypress/{integration/EventEmitter.spec.js → e2e/EventEmitter.cy.js} +0 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
const
|
|
2
|
+
webpackPreprocessor = require('@cypress/webpack-preprocessor'),
|
|
3
|
+
webpackOptions = {
|
|
4
|
+
mode: 'development',
|
|
5
|
+
devtool: 'module-source-map', // See https://survivejs.com/webpack/building/source-maps/
|
|
6
|
+
// devtool: 'cheap-module-source-map', // See https://survivejs.com/webpack/building/source-maps/
|
|
7
|
+
module: {
|
|
8
|
+
rules: [
|
|
9
|
+
{
|
|
10
|
+
test: /\.(js|jsx|mjs)$/,
|
|
11
|
+
exclude: /node_modules/,
|
|
12
|
+
// exclude: /node_modules\/(?!(@onehat)\/).*/,
|
|
13
|
+
loader: 'babel-loader',
|
|
14
|
+
options: {
|
|
15
|
+
cacheDirectory: false,
|
|
16
|
+
presets: [
|
|
17
|
+
'@babel/preset-env'
|
|
18
|
+
],
|
|
19
|
+
plugins: [
|
|
20
|
+
'@babel/plugin-proposal-class-properties',
|
|
21
|
+
'@babel/plugin-transform-runtime'
|
|
22
|
+
],
|
|
23
|
+
sourceType: 'unambiguous',
|
|
24
|
+
},
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
module.exports = (on) => {
|
|
31
|
+
on('file:preprocessor', webpackPreprocessor({
|
|
32
|
+
webpackOptions,
|
|
33
|
+
watchOptions: {},
|
|
34
|
+
}));
|
|
35
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { defineConfig } from "cypress";
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
e2e: {
|
|
5
|
+
chromeWebSecurity: false,
|
|
6
|
+
setupNodeEvents(on, config) {
|
|
7
|
+
// bind to the event we care about
|
|
8
|
+
// on('<event>', (arg1, arg2) => {
|
|
9
|
+
// // plugin stuff here
|
|
10
|
+
// })
|
|
11
|
+
},
|
|
12
|
+
}
|
|
13
|
+
});
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onehat/events",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.6",
|
|
4
4
|
"description": "Node.js 'events' module with extra enhancements",
|
|
5
5
|
"main": "src/EventEmitter.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"test": "npx cypress open
|
|
8
|
+
"test": "npx cypress open"
|
|
9
9
|
},
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
@@ -41,16 +41,16 @@
|
|
|
41
41
|
"lodash": "^4.17.21"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@babel/core": "^7.
|
|
45
|
-
"@babel/node": "^7.
|
|
46
|
-
"@babel/plugin-proposal-class-properties": "^7.
|
|
47
|
-
"@babel/plugin-transform-runtime": "^7.
|
|
48
|
-
"@babel/preset-env": "^7.
|
|
49
|
-
"@babel/register": "^7.
|
|
50
|
-
"@babel/runtime": "^7.
|
|
51
|
-
"@cypress/webpack-preprocessor": "^5.
|
|
52
|
-
"babel-loader": "^
|
|
53
|
-
"cypress": "
|
|
54
|
-
"webpack": "^5.
|
|
44
|
+
"@babel/core": "^7.22.1",
|
|
45
|
+
"@babel/node": "^7.22.1",
|
|
46
|
+
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
47
|
+
"@babel/plugin-transform-runtime": "^7.19.6",
|
|
48
|
+
"@babel/preset-env": "^7.22.4",
|
|
49
|
+
"@babel/register": "^7.21.0",
|
|
50
|
+
"@babel/runtime": "^7.22.3",
|
|
51
|
+
"@cypress/webpack-preprocessor": "^5.17.1",
|
|
52
|
+
"babel-loader": "^9.1.2",
|
|
53
|
+
"cypress": "12.13.0",
|
|
54
|
+
"webpack": "^5.85.0"
|
|
55
55
|
}
|
|
56
56
|
}
|
package/src/EventEmitter.js
CHANGED
|
@@ -8,7 +8,6 @@ import _ from 'lodash';
|
|
|
8
8
|
* can be optionally emitted at resumption of events.
|
|
9
9
|
* - Relaying of events from one object to another. A relayed event will appear to be emitted
|
|
10
10
|
* from the relaying object, not from the origin object.
|
|
11
|
-
*
|
|
12
11
|
*/
|
|
13
12
|
export default class EventEmitter extends EE {
|
|
14
13
|
|
|
@@ -88,7 +87,7 @@ export default class EventEmitter extends EE {
|
|
|
88
87
|
* so we can utilize the return values of handlers in an async fashion.
|
|
89
88
|
* @return {boolean} result - false if any of the handlers return false, otherwise true.
|
|
90
89
|
*/
|
|
91
|
-
|
|
90
|
+
async emitAsync(name) {
|
|
92
91
|
const handlers = this._events[name],
|
|
93
92
|
args = _.slice(arguments, 1);
|
|
94
93
|
let results = true,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|