Skip to content

Commit

Permalink
esModuleInterop enabled; typescript tests added to pretest
Browse files Browse the repository at this point in the history
  • Loading branch information
dex4er committed Feb 4, 2018
1 parent 96b28d3 commit da269a2
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 13 deletions.
3 changes: 0 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ matrix:
install:
- npm install
- if [ -n "$NPM_INSTALL_PACKAGES" ]; then npm install $NPM_INSTALL_PACKAGES; fi
- npm install typescript tslint tslint-config-standard

script:
- npm run ${NPM_RUN_SCRIPT:-test} -- $TAP_ARGS
- node_modules/.bin/tsc --pretty
- node_modules/.bin/tslint -t stylish -p .
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"typescript.tsdk": "node_modules/typescript/lib"
}
4 changes: 2 additions & 2 deletions examples/read-all.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
'use strict'

const PromiseReadable = require('../lib/promise-readable')
const { createReadStream } = require('fs')
const fs = require('fs')

async function main () {
const rstream = new PromiseReadable(createReadStream(process.argv[2] || '/etc/hosts', {
const rstream = new PromiseReadable(fs.createReadStream(process.argv[2] || '/etc/hosts', {
highWaterMark: Number(process.argv[3]) || 1024
}))
const data = await rstream.readAll()
Expand Down
4 changes: 2 additions & 2 deletions examples/read-by-chunks-ts.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import PromiseReadable from '../lib/promise-readable'

import { createReadStream } from 'fs'
import fs from 'fs'

type Chunk = Buffer | string | undefined

async function main () {
const rstream = new PromiseReadable(createReadStream(process.argv[2] || '/etc/hosts', {
const rstream = new PromiseReadable(fs.createReadStream(process.argv[2] || '/etc/hosts', {
highWaterMark: Number(process.argv[3]) || 1024
}))

Expand Down
4 changes: 2 additions & 2 deletions examples/read-by-chunks.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
'use strict'

const PromiseReadable = require('../lib/promise-readable')
const { createReadStream } = require('fs')
const fs = require('fs')

async function main () {
const rstream = new PromiseReadable(createReadStream(process.argv[2] || '/etc/hosts', {
const rstream = new PromiseReadable(fs.createReadStream(process.argv[2] || '/etc/hosts', {
highWaterMark: Number(process.argv[3]) || 1024
}))

Expand Down
4 changes: 2 additions & 2 deletions examples/read-once-end.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use strict'

var PromiseReadable = require('../lib/promise-readable')
var createReadStream = require('fs').createReadStream
var fs = require('fs')

var rstream = new PromiseReadable(createReadStream(process.argv[2] || '/etc/hosts'))
var rstream = new PromiseReadable(fs.createReadStream(process.argv[2] || '/etc/hosts'))

rstream.stream.pipe(process.stdout)

Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,13 @@
"snazzy": "^7.0.0",
"standard": "^10.0.3",
"tap": "^11.0.1",
"tap-given": "^0.6.0"
"tap-given": "^0.6.0",
"tslint": "^5.9.1",
"tslint-config-standard": "^7.0.0",
"typescript": "^2.7.1"
},
"scripts": {
"pretest": "standard --verbose | snazzy",
"pretest": "standard --verbose | snazzy && tsc --noEmit --pretty && tslint -t stylish -p .",
"test": "tap test/*.js",
"test:coverage": "npm test -- --coverage",
"test:onchange:lcovonly": "npm run -s test-coverage -- -R min --coverage-report lcovonly; onchange '**/*.js' -- npm run -s test-coverage -- -R min --coverage-report lcovonly",
Expand Down

0 comments on commit da269a2

Please sign in to comment.