Files
pnpm/test/outdated.ts
Unknown cd6f4d1669 fix: outdated output when everything is up-to-date
When everything is up-to-date `pnpm outdated`
should not print anything.
2017-09-17 18:39:48 +03:00

39 lines
1.1 KiB
TypeScript

import tape = require('tape')
import promisifyTape from 'tape-promise'
import path = require('path')
import {stripIndents} from 'common-tags'
import {
execPnpm,
execPnpmSync,
tempDir,
} from './utils'
import normalizeNewline = require('normalize-newline')
const hasOutdatedDepsFixture = path.join(__dirname, 'packages', 'has-outdated-deps')
const hasNotOutdatedDepsFixture = path.join(__dirname, 'packages', 'has-not-outdated-deps')
const test = promisifyTape(tape)
test('pnpm outdated', async (t: tape.Test) => {
process.chdir(hasOutdatedDepsFixture)
const result = execPnpmSync('outdated')
t.equal(result.status, 0)
t.equal(normalizeNewline(result.stdout.toString()), stripIndents`
Package Current Wanted Latest
is-negative 1.0.0 1.1.0 2.1.0
is-positive 1.0.0 3.1.0 3.1.0
` + '\n')
})
test('pnpm outdated does not print anything when all is good', async (t: tape.Test) => {
process.chdir(hasNotOutdatedDepsFixture)
const result = execPnpmSync('outdated')
t.equal(result.status, 0)
t.equal(normalizeNewline(result.stdout.toString()), '')
})