Skip to content

Commit

Permalink
fix: enabling disabled tests rename all pkgs to lib (#1941)
Browse files Browse the repository at this point in the history
We weren't calling a few more tests and I standardized the package layout so this is harder to miss.
  • Loading branch information
reconbot authored Sep 25, 2019
1 parent 53e2085 commit b1cc840
Show file tree
Hide file tree
Showing 45 changed files with 35 additions and 35 deletions.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable no-new */

const BindingAbstract = require('./binding-abstract')
const BindingAbstract = require('../')

describe('BindingAbstract', () => {
it('constructs', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/binding-abstract/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@serialport/binding-abstract",
"version": "8.0.1",
"main": "binding-abstract.js",
"main": "lib",
"keywords": [
"serialport-binding"
],
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const BindingMock = require('./binding-mock')
const BindingMock = require('../')

// copypasta from bindings/lib/bindings.test.js
function shouldReject(promise, errType = Error, message = 'Should have rejected') {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/binding-mock/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@serialport/binding-mock",
"version": "8.0.1",
"main": "binding-mock.js",
"main": "lib",
"keywords": [
"serialport-binding"
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const serialNumParser = require('./win32-sn-parser')

const devices = {
const devices = Object.freeze({
'FTDI Device': {
pnpId: 'FTDIBUS\\VID_0403+PID_6015+DO004ZB7A\\0000',
serialNumber: 'DO004ZB7',
Expand All @@ -25,7 +25,7 @@ const devices = {
pnpId: 'WATEVER\\Whoever\\However!',
serialNumber: null,
},
}
})

describe('serialNumParser', () => {
Object.entries(devices).forEach(([device, info]) => {
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions packages/list/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "@serialport/list",
"version": "8.0.2",
"main": "lib/list.js",
"main": "lib",
"bin": {
"serialport-list": "./lib/list.js"
"serialport-list": "./lib/index.js"
},
"dependencies": {
"@serialport/bindings": "^8.0.2",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable no-new */

const sinon = require('sinon')
const ByteLengthParser = require('./byte-length')
const ByteLengthParser = require('../')

describe('ByteLengthParser', () => {
it('emits data events every 8 bytes', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/parser-byte-length/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@serialport/parser-byte-length",
"version": "8.0.1",
"main": "byte-length.js",
"main": "lib",
"engines": {
"node": ">=8.6.0"
},
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const sinon = require('sinon')
const CCTalkParser = require('./cctalk')
const CCTalkParser = require('../')

describe('CCTalkParser', () => {
it('constructs', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/parser-cctalk/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@serialport/parser-cctalk",
"version": "8.0.1",
"main": "cctalk.js",
"main": "lib",
"engines": {
"node": ">=8.6.0"
},
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
/* eslint-disable no-new */

const sinon = require('sinon')

const DelimiterParser = require('./delimiter')
const DelimiterParser = require('../')

describe('DelimiterParser', () => {
it('transforms data to strings split on a delimiter', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/parser-delimiter/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@serialport/parser-delimiter",
"main": "delimiter.js",
"main": "lib",
"version": "8.0.1",
"engines": {
"node": ">=8.6.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable no-new */

const sinon = require('sinon')
const InterByteTimeoutParser = require('./inter-byte-timeout')
const InterByteTimeoutParser = require('../')

function wait(interval) {
return new Promise((resolve, reject) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/parser-inter-byte-timeout/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@serialport/parser-inter-byte-timeout",
"version": "8.0.1",
"main": "inter-byte-timeout.js",
"main": "lib",
"engines": {
"node": ">=8.6.0"
},
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const sinon = require('sinon')

const ReadlineParser = require('./readline')
const ReadlineParser = require('../')

describe('ReadlineParser', () => {
it('transforms data to strings split on a delimiter', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/parser-readline/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@serialport/parser-readline",
"main": "readline.js",
"main": "lib",
"version": "8.0.1",
"dependencies": {
"@serialport/parser-delimiter": "^8.0.1"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const sinon = require('sinon')

const ReadyParser = require('./ready')
const ReadyParser = require('../')

describe('ReadyParser', () => {
it('emits data received after the ready data', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/parser-ready/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@serialport/parser-ready",
"main": "ready.js",
"main": "lib",
"version": "8.0.1",
"engines": {
"node": ">=8.6.0"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const sinon = require('sinon')

const RegexParser = require('./regex')
const RegexParser = require('../')

describe('RegexParser', () => {
it('transforms data to strings split on either carriage return or new line', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/parser-regex/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@serialport/parser-regex",
"main": "regex.js",
"main": "lib",
"version": "8.0.1",
"engines": {
"node": ">=8.6.0"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const sinon = require('sinon')

const SlipEncoder = require('./slip-encoder')
const SlipEncoder = require('../')

describe('SlipEncoderParser', () => {
it('Adds one delimiter to one-byte messages', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/parser-slip-encoder/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@serialport/parser-slip-encoder",
"main": "slip-encoder.js",
"main": "lib",
"version": "8.0.1",
"engines": {
"node": ">=8.6.0"
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions packages/repl/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "@serialport/repl",
"version": "8.0.2",
"main": "lib/repl.js",
"main": "lib",
"bin": {
"serialport-repl": "./lib/repl.js"
"serialport-repl": "./lib/index.js"
},
"dependencies": {
"promirepl": "^2.0.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const crypto = require('crypto')
const SerialPort = require('.')
const SerialPort = require('../')

let platform
switch (process.platform) {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const sinon = require('sinon')
chai.use(require('chai-subset'))
const assert = chai.assert

const SerialPort = require('./stream')
const SerialPort = require('../')
const MockBinding = require('@serialport/binding-mock')

describe('SerialPort', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/stream/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@serialport/stream",
"version": "8.0.2",
"main": "stream.js",
"main": "lib",
"dependencies": {
"@serialport/binding-mock": "^8.0.1",
"debug": "^4.1.1"
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions packages/terminal/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "@serialport/terminal",
"version": "8.0.2",
"main": "lib/terminal.js",
"main": "lib",
"bin": {
"serialport-terminal": "./lib/terminal.js"
"serialport-terminal": "./lib/index.js"
},
"dependencies": {
"commander": "^2.13.0",
Expand Down
5 changes: 4 additions & 1 deletion test/initializers/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
const fs = require('fs')
const files = fs.readdirSync(__dirname).filter(file => file !== 'index.js' && file.match(/\.js$/))
files.forEach(file => require(`./${file}`))
files.forEach(file => {
console.log(`Loading ${file}`)
require(`./${file}`)
})
2 changes: 0 additions & 2 deletions test/mocha.opts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
--bail
--require ./test/initializers
packages/*/test/**/*.js
packages/**/*.test.js

0 comments on commit b1cc840

Please sign in to comment.