Replace JavaScript Standard Style with Prettier.

This commit is contained in:
David Braun 2017-10-16 13:24:12 -04:00
parent b9638f2113
commit d7355e17e1
No known key found for this signature in database
GPG key ID: 5694EEC4D129BDCF
9 changed files with 647 additions and 675 deletions

View file

@ -7,72 +7,72 @@
// Test various correct and incorrect permutations of send-only,
// receive-only, and bidirectional channels.
'use strict'
"use strict";
const assert = require(`@nodeguy/assert`)
const Channel = require('../../lib')
const assert = require(`@nodeguy/assert`);
const Channel = require("../../lib");
it(`perm`, function () {
const c = Channel()
const cr = Channel().readOnly()
const cs = Channel().writeOnly()
it(`perm`, function() {
const c = Channel();
const cr = Channel().readOnly();
const cs = Channel().writeOnly();
const n = 0
const n = 0;
assert.throws(() => {
Channel.shift(n) // ERROR "receive from non-chan"
})
Channel.shift(n); // ERROR "receive from non-chan"
});
assert.throws(() => {
Channel.push(2, n) // ERROR "send to non-chan"
})
Channel.push(2, n); // ERROR "send to non-chan"
});
c.push(0) // ok
c.shift() // ok
c.push(0); // ok
c.shift(); // ok
assert.throws(() => {
cr.push(0) // ERROR "send"
})
cr.push(0); // ERROR "send"
});
cr.shift() // ok
cr.shift(); // ok
cs.push(0) // ok
cs.push(0); // ok
assert.throws(() => {
cs.shift() // ERROR "receive"
})
cs.shift(); // ERROR "receive"
});
Channel.select(
c.push(0), // ok
c.shift() // ok
)
c.shift() // ok
);
assert.throws(() => {
Channel.select(
cr.push(0) // ERROR "send"
)
})
);
});
Channel.select(cr.shift()) // ok
Channel.select(cr.shift()); // ok
Channel.select(cs.push(0)) // ok
Channel.select(cs.push(0)); // ok
assert.throws(() => {
Channel.select(cs.shift()) // ERROR "receive"
})
Channel.select(cs.shift()); // ERROR "receive"
});
assert.throws(() => {
cs.forEach(() => {}) // ERROR "receive"
})
cs.forEach(() => {}); // ERROR "receive"
});
c.close()
cs.close()
c.close();
cs.close();
assert.throws(() => {
cr.close() // ERROR "receive"
})
cr.close(); // ERROR "receive"
});
assert.throws(() => {
Channel.close(n) // ERROR "invalid operation.*non-chan type"
})
})
Channel.close(n); // ERROR "invalid operation.*non-chan type"
});
});