mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
feature(cloudcmd) sinon, sinon-called-with-diff -> @cloudcmd/stub
This commit is contained in:
parent
2f56d2b5ca
commit
497f7bcd40
24 changed files with 182 additions and 222 deletions
|
|
@ -1,7 +1,5 @@
|
|||
'use strict';
|
||||
|
||||
const {promisify} = require('util');
|
||||
|
||||
const test = require('tape');
|
||||
const io = require('socket.io-client');
|
||||
|
||||
|
|
@ -23,8 +21,6 @@ test('distribute: export', async (t) => {
|
|||
const url = `http://localhost:${port}/distribute?port=${1111}`;
|
||||
const socket = io.connect(url);
|
||||
|
||||
const name = config('name');
|
||||
|
||||
socket.on('connect', () => {
|
||||
socket.emit('auth', 'a');
|
||||
});
|
||||
|
|
@ -58,8 +54,6 @@ test('distribute: export: config', async (t) => {
|
|||
const url = `http://localhost:${port}/distribute?port=${1111}`;
|
||||
const socket = io.connect(url);
|
||||
|
||||
const name = config('name');
|
||||
|
||||
socket.on('connect', () => {
|
||||
socket.emit('auth', 'a');
|
||||
});
|
||||
|
|
|
|||
|
|
@ -3,18 +3,14 @@
|
|||
const test = require('tape');
|
||||
const {promisify} = require('util');
|
||||
const tryToCatch = require('try-to-catch');
|
||||
const io = require('socket.io-client');
|
||||
const mockRequire = require('mock-require');
|
||||
|
||||
const {connect} = require('../../test/before');
|
||||
|
||||
const config = require('../config');
|
||||
const distribute = {
|
||||
import: promisify(require('./import')),
|
||||
};
|
||||
|
||||
test('distribute: import: canceled', async (t) => {
|
||||
const {done, port} = await connect({
|
||||
const {done} = await connect({
|
||||
config: {
|
||||
export: false,
|
||||
import: false,
|
||||
|
|
@ -138,7 +134,7 @@ test('distribute: import: received: no name', async (t) => {
|
|||
});
|
||||
|
||||
test('distribute: import: error', async (t) => {
|
||||
const {done, port} = await connect({
|
||||
const {done} = await connect({
|
||||
config: {
|
||||
import: true,
|
||||
export: false,
|
||||
|
|
@ -160,7 +156,7 @@ test('distribute: import: error', async (t) => {
|
|||
});
|
||||
|
||||
test('distribute: import: config:change: no export', async (t) => {
|
||||
const {done, port} = await connect({
|
||||
const {done} = await connect({
|
||||
config: {
|
||||
import: true,
|
||||
export: false,
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ const config = require('../config');
|
|||
|
||||
test('distribute: log: getMessage', (t) => {
|
||||
const e = 'hello';
|
||||
const result = log.getMessage(e)
|
||||
const result = log.getMessage(e);
|
||||
|
||||
t.equal(e, result, 'should equal');
|
||||
t.end();
|
||||
|
|
@ -16,7 +16,7 @@ test('distribute: log: getMessage: message', (t) => {
|
|||
const message = 'hello';
|
||||
const result = log.getMessage({
|
||||
message
|
||||
})
|
||||
});
|
||||
|
||||
t.equal(result, message, 'should equal');
|
||||
t.end();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue