Skip to content

Commit

Permalink
fix: mix sync methods to default export
Browse files Browse the repository at this point in the history
  • Loading branch information
antongolub committed Jun 7, 2024
1 parent 39520e1 commit 8a5ab95
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@webpod/ps",
"version": "0.0.0-beta.4",
"version": "0.0.0-beta.5",
"description": "A process lookup utility",
"publishConfig": {
"access": "public"
Expand Down
6 changes: 3 additions & 3 deletions src/main/ts/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { kill, lookup, tree } from './ps.js'
import { kill, lookup, lookupSync, tree, treeSync } from './ps.js'

export type * from './ps.js'
export { kill, lookup, tree } from './ps.js'
export default { lookup, kill, tree }
export { kill, lookup, lookupSync, tree, treeSync } from './ps.js'
export default { kill, lookup, lookupSync, tree, treeSync }
5 changes: 4 additions & 1 deletion src/test/js/index.test.cjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
const assert = require('node:assert')
const { describe, it } = require('node:test')
const { lookup, kill } = require('@webpod/ps')
const { lookup, kill, tree } = require('@webpod/ps')

describe('cjs index()', () => {
it('has proper exports', () => {
assert.equal(typeof lookup, 'function')
assert.equal(typeof lookup.sync, 'function')
assert.equal(typeof tree, 'function')
assert.equal(typeof tree.sync, 'function')
assert.equal(typeof kill, 'function')
})
})
5 changes: 4 additions & 1 deletion src/test/js/index.test.mjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import assert from 'node:assert'
import { describe, it } from 'node:test'
import { lookup, kill } from '@webpod/ps'
import { lookup, kill, tree } from '@webpod/ps'

describe('mjs index', () => {
it('has proper exports', () => {
assert.equal(typeof lookup, 'function')
assert.equal(typeof lookup.sync, 'function')
assert.equal(typeof tree, 'function')
assert.equal(typeof tree.sync, 'function')
assert.equal(typeof kill, 'function')
})
})
6 changes: 5 additions & 1 deletion src/test/ts/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
import * as assert from 'node:assert'
import { describe, it } from 'node:test'
import ps, { kill, lookup, tree } from '../../main/ts/index.ts'
import ps, { kill, lookup, tree, treeSync, lookupSync } from '../../main/ts/index.ts'

describe('index', () => {
it('has proper exports', () => {
assert.equal(ps.lookup, lookup)
assert.equal(ps.lookup.sync, lookupSync)
assert.equal(ps.kill, kill)
assert.equal(ps.tree, tree)
assert.equal(ps.tree.sync, treeSync)
assert.equal(typeof lookup, 'function')
assert.equal(typeof lookupSync, 'function')
assert.equal(typeof kill, 'function')
assert.equal(typeof tree, 'function')
assert.equal(typeof treeSync, 'function')
})
})

0 comments on commit 8a5ab95

Please sign in to comment.