Added some tests

This commit is contained in:
2021-06-23 22:30:45 +02:00
parent 24f897e907
commit 3d3d7fae48
3796 changed files with 218744 additions and 3 deletions

1
tests/node_modules/re-emitter/.npmignore generated vendored Normal file
View File

@@ -0,0 +1 @@
img.jpg

7
tests/node_modules/re-emitter/.travis.yml generated vendored Normal file
View File

@@ -0,0 +1,7 @@
language: node_js
node_js:
- 'node'
env:
global:
- secure: Ea1OfxmffsNWcUN3UEfRltWr243sO/vfUuLqdrI5n3MAqY67nN5GrcJEetGf/7aMJU4yfnRYepaYrO9jdAC8CLvTscoS/Nwhzbwg/VYwPlqfLpZEY6AmTiKRNgtlSox4H1w9nQ4ULfVLy7EP4S7p+dlJZQceXYxpbdVaNCZgTC8=
- secure: gErL1Xok7GH7EYUVEeEaivFCHqeWBBYCH0DEDVwOi8ni2053sBwEDMYBwKb1IhoYWWeGHwVkDz8y+Ex/SJ4rxmUHhI9ZfNaPfqkn8EW45a+yIQW3uocL1yXDaj+8iE/BGqhaDUkpFT6Bd04Hgd8Llr4RYVjzkQlOCIRUsFxVp6k=

14
tests/node_modules/re-emitter/.zuul.yml generated vendored Normal file
View File

@@ -0,0 +1,14 @@
ui: tape
browsers:
- name: chrome
version: latest
- name: firefox
version: latest
- name: safari
version: latest
- name: microsoftedge
version: latest
- name: ie
version: latest
- name: android
version: latest

19
tests/node_modules/re-emitter/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,19 @@
Copyright (c) 2012 Raynos.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

54
tests/node_modules/re-emitter/README.md generated vendored Normal file
View File

@@ -0,0 +1,54 @@
# re-emitter [![travis](https://img.shields.io/travis/feross/re-emitter/master.svg)](https://travis-ci.org/feross/re-emitter) [![npm](https://img.shields.io/npm/v/re-emitter.svg)](https://npmjs.org/package/re-emitter) [![downloads](https://img.shields.io/npm/dm/re-emitter.svg)](https://npmjs.org/package/re-emitter)
#### Re emit events from another emitter
![reemit](https://raw.githubusercontent.com/feross/re-emitter/master/img.jpg)
[![Sauce Test Status](https://saucelabs.com/browser-matrix/magnet-uri.svg)](https://saucelabs.com/u/magnet-uri)
Works in node and the browser with [browserify](http://browserify.org/).
[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)
### install
```
npm install re-emitter
```
### usage
```js
var reemit = require('re-emitter')
var emitter = new EventEmitter()
var other = new EventEmitter()
reemit(emitter, other, ['foo', 'bar'])
other.on('foo', function () {
// foo will fire on other emitter!
})
emitter.emit('foo')
other.on('baz', function () {
// baz will not fire on other emitter
})
emitter.emit('baz')
```
#### canceling re-emitting
`reemit` returns a `function`, which when called, cancels all re-emitting by removing the
event listeners which it added.
### contributors
- Raynos
- Feross
### license
MIT. Copyright (c) Raynos.

31
tests/node_modules/re-emitter/index.js generated vendored Normal file
View File

@@ -0,0 +1,31 @@
module.exports = reemit
module.exports.filter = filter
var EventEmitter = require('events').EventEmitter
function reemit (source, target, events) {
if (!Array.isArray(events)) events = [ events ]
var listeners = []
events.forEach(function (event) {
var listener = function () {
var args = [].slice.call(arguments)
args.unshift(event)
target.emit.apply(target, args)
}
listeners.push(listener)
source.on(event, listener)
})
return function cancel () {
events.forEach(function (event, i) {
source.removeListener(event, listeners[i])
})
}
}
function filter (source, events) {
var emitter = new EventEmitter()
reemit(source, emitter, events)
return emitter
}

76
tests/node_modules/re-emitter/package.json generated vendored Normal file
View File

@@ -0,0 +1,76 @@
{
"_from": "re-emitter@1.1.3",
"_id": "re-emitter@1.1.3",
"_inBundle": false,
"_integrity": "sha1-+p4xn/3u6zWycpbvDz03TawvUqc=",
"_location": "/re-emitter",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "re-emitter@1.1.3",
"name": "re-emitter",
"escapedName": "re-emitter",
"rawSpec": "1.1.3",
"saveSpec": null,
"fetchSpec": "1.1.3"
},
"_requiredBy": [
"/tap-out"
],
"_resolved": "https://registry.npmjs.org/re-emitter/-/re-emitter-1.1.3.tgz",
"_shasum": "fa9e319ffdeeeb35b27296ef0f3d374dac2f52a7",
"_spec": "re-emitter@1.1.3",
"_where": "/home/lilleman/go/src/gitlab.larvit.se/power-plan/auth/tests/node_modules/tap-out",
"author": {
"name": "Raynos",
"email": "raynos2@gmail.com"
},
"bugs": {
"url": "https://github.com/feross/re-emitter/issues",
"email": "raynos2@gmail.com"
},
"bundleDependencies": false,
"contributors": [
{
"name": "Jake Verbaten"
},
{
"name": "Feross Aboukhadijeh",
"email": "feross@feross.org",
"url": "http://feross.org/"
}
],
"dependencies": {},
"deprecated": false,
"description": "Re emit events from another emitter",
"devDependencies": {
"standard": "^6.0.7",
"tape": "^4.0.0",
"zuul": "^3.0.0"
},
"homepage": "https://github.com/feross/re-emitter",
"keywords": [
"reemit",
"re emit",
"re-emit",
"reemitter",
"filter events",
"events",
"emitter"
],
"license": "MIT",
"main": "index.js",
"name": "re-emitter",
"repository": {
"type": "git",
"url": "git://github.com/feross/re-emitter.git"
},
"scripts": {
"test": "standard && npm run test-node && npm run test-browser",
"test-browser": "zuul -- test/*.js",
"test-browser-local": "zuul --local -- test/*.js",
"test-node": "tape test/*.js"
},
"version": "1.1.3"
}

93
tests/node_modules/re-emitter/test/basic.js generated vendored Normal file
View File

@@ -0,0 +1,93 @@
var EventEmitter = require('events').EventEmitter
var reemit = require('../')
var test = require('tape')
test('Re-emit events from another emitter', function (t) {
t.plan(1)
var emitter = new EventEmitter()
var other = new EventEmitter()
reemit(emitter, other, ['foo', 'bar'])
other.on('foo', function () {
t.pass('foo fired')
})
emitter.emit('foo')
other.on('baz', function () {
t.fail('baz should not fire on other emitter')
})
emitter.emit('baz')
emitter.on('bar', function () {
t.fail('bar should not fire on original emitter')
})
other.emit('bar')
})
test('Cancel reemitting at some point in the future', function (t) {
t.plan(2)
var emitter = new EventEmitter()
var other = new EventEmitter()
var cancel = reemit(emitter, other, ['foo', 'bar'])
other.on('foo', function () {
t.pass('foo fired')
})
// these should fire
emitter.emit('foo')
emitter.emit('foo')
cancel()
// none of these should fire
emitter.emit('foo')
emitter.emit('foo')
emitter.emit('foo')
})
test('Re-emit events from another emitter with arguments', function (t) {
t.plan(4)
var emitter = new EventEmitter()
var other = new EventEmitter()
reemit(emitter, other, ['foo', 'bar'])
other.on('foo', function (arg1, arg2) {
t.pass('foo fired')
t.equal(arg1, 'arg1')
t.equal(arg2, 'arg2')
t.equal(arguments[2], undefined)
})
emitter.emit('foo', 'arg1', 'arg2')
})
test('Filter events from another emitter', function (t) {
t.plan(1)
var emitter = new EventEmitter()
var other = reemit.filter(emitter, ['foo', 'bar'])
other.on('foo', function () {
t.pass('foo fired')
})
emitter.emit('foo')
other.on('baz', function () {
t.fail('baz should not fire on other emitter')
})
emitter.emit('baz')
emitter.on('bar', function () {
t.fail('bar should not fire on original emitter')
})
other.emit('bar')
})