Catalog npm
Back to packageRELEASE DETAILS

0.1.6

npm

@0ti.me/ts-test-deps

A library for adding test tooling

Published29 May 2021
Direct dependencies37
Transitive dependenciesNot calculated

README

Current package documentation

Objective

Simplify maintenance of test dependencies by just shoving them all into one npm package.

Usage

In your [https://mochajs.org/#-require-module-r-module](mocha require configuration), require a file which contains this line:

// Example file will be referred to as `test/add-deps-global.js`
global.deps = require('@0time/ts-test-deps');

Then in your tests, you can use the exports of src/index.js like this:

const {bluebird, chai, expect, tquire, uuid} = deps;

This works because in the test/add-deps-global.js file, we added the deps global variable containing these features.

tquire

Currently unconfigurable, the tquire feature will find the source file which maps to the file you're trying to test if you lay out your test files consistently.

For unit tests:

// Given files:
// * src/some/source/file.js
// * test/unit/some/source/file.js
// and given an environment variable NODE_ENV set to `unit`
// If this file is test/unit/some/source/file.js, this line will 'require' the src/some/source/file.js module
const moduleFromSrcSomeSourceFile = tquire(__filename);

For integration tests:

// Given files:
// * src/some/source/file.js
// * test/integration/some/source/file.js
// and given an environment variable NODE_ENV set to `integration`
// If this file is test/integration/some/source/file.js, this line will 'require' the src/some/source/file.js module
const moduleFromSrcSomeSourceFile = tquire(__filename);

d (short for a modified mocha describe function call)

The d feature will use the same logic as tquire to call describe with the source filename.

// This
d(__filename, () => {
});
// is roughly equivalent (for unit testing) to:
describe(
  __filename
    .replace(process.cwd(), '')
    .replace(/\/?test\/unit/, ''), () => {
});

Configuration Templates

In the ./configuration-templates directory, you can find configuration files which can be used in various ways.

Quickstart:

yarn

yarn add --dev @0ti.me/ts-test-deps
yarn run link-ts-test-deps

npm

npm install --save-dev @0ti.me/ts-test-deps
$(npm bin)/link-ts-test-deps

nyc.config.js

You can use it as is with a symlink

#!/usr/bin/env bash

ln -s node_modules/@0ti.me/ts-test-deps/configuration-templates/nyc.config.js

Or you can require it (in your own nyc.config.js)

const testDepsNycConfig = require('@0ti.me/ts-test-deps/configuration-templates/nyc.config.js');

module.exports = testDepsNycConfig;

Or you can require it and override things you want to change. (in your own nyc.config.js)

const testDepsNycConfig = require('@0ti.me/ts-test-deps/configuration-templates/nyc.config.js');

module.exports = Object.assign(
  {},
  testDepsNycConfig,
  {branches: 10},
);

Files similar to nyc.config.js:

  • eslintrc.js☭
  • huskyrc.js☭
  • lint-staged.config.js
  • mocharc.js☭
  • prettierrc.js☭

☭ The files with this mark must be symlinked to project-dir/.filename like so:

ln -s node_modules/@0ti.me/ts-test-deps/configuration-templates/eslintrc.js .eslintrc.js

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 37

Native requirements
37 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
@0ti.me/en-path
Environment
{
  "local_name": "@0ti.me/en-path",
  "alias": false,
  "peer_metadata": null
}
^0.1.0runtime
@types/bluebird
Environment
{
  "local_name": "@types/bluebird",
  "alias": false,
  "peer_metadata": null
}
^3.5.35runtime
@types/chai
Environment
{
  "local_name": "@types/chai",
  "alias": false,
  "peer_metadata": null
}
^4.1.3runtime
@types/chai-as-promised
Environment
{
  "local_name": "@types/chai-as-promised",
  "alias": false,
  "peer_metadata": null
}
^7.1.4runtime
@types/lodash
Environment
{
  "local_name": "@types/lodash",
  "alias": false,
  "peer_metadata": null
}
^4.14.169runtime
@types/minimist
Environment
{
  "local_name": "@types/minimist",
  "alias": false,
  "peer_metadata": null
}
^1.2.1runtime
@types/mocha
Environment
{
  "local_name": "@types/mocha",
  "alias": false,
  "peer_metadata": null
}
^8.2.2runtime
@types/node
Environment
{
  "local_name": "@types/node",
  "alias": false,
  "peer_metadata": null
}
^15.6.1runtime
@types/proxyquire
Environment
{
  "local_name": "@types/proxyquire",
  "alias": false,
  "peer_metadata": null
}
^1.3.28runtime
@types/sinon
Environment
{
  "local_name": "@types/sinon",
  "alias": false,
  "peer_metadata": null
}
^10.0.1runtime
@types/sinon-as-promised
Environment
{
  "local_name": "@types/sinon-as-promised",
  "alias": false,
  "peer_metadata": null
}
^4.0.14runtime
@types/sinon-chai
Environment
{
  "local_name": "@types/sinon-chai",
  "alias": false,
  "peer_metadata": null
}
^3.2.5runtime
@types/uuid
Environment
{
  "local_name": "@types/uuid",
  "alias": false,
  "peer_metadata": null
}
^8.3.0runtime
@typescript-eslint/eslint-plugin
Environment
{
  "local_name": "@typescript-eslint/eslint-plugin",
  "alias": false,
  "peer_metadata": null
}
^4.25.0runtime
@typescript-eslint/eslint-plugin-tslint
Environment
{
  "local_name": "@typescript-eslint/eslint-plugin-tslint",
  "alias": false,
  "peer_metadata": null
}
^4.25.0runtime
@typescript-eslint/parser
Environment
{
  "local_name": "@typescript-eslint/parser",
  "alias": false,
  "peer_metadata": null
}
^4.25.0runtime
bluebird
Environment
{
  "local_name": "bluebird",
  "alias": false,
  "peer_metadata": null
}
^3.7.1runtime
chai
Environment
{
  "local_name": "chai",
  "alias": false,
  "peer_metadata": null
}
^4.2.0runtime
chai-as-promised
Environment
{
  "local_name": "chai-as-promised",
  "alias": false,
  "peer_metadata": null
}
^7.1.1runtime
coveralls
Environment
{
  "local_name": "coveralls",
  "alias": false,
  "peer_metadata": null
}
^3.0.7runtime
eslint
Environment
{
  "local_name": "eslint",
  "alias": false,
  "peer_metadata": null
}
^7.27.0runtime
eslint-config-prettier
Environment
{
  "local_name": "eslint-config-prettier",
  "alias": false,
  "peer_metadata": null
}
^8.3.0runtime
eslint-plugin-prettier
Environment
{
  "local_name": "eslint-plugin-prettier",
  "alias": false,
  "peer_metadata": null
}
^3.1.1runtime
husky
Environment
{
  "local_name": "husky",
  "alias": false,
  "peer_metadata": null
}
^6.0.0runtime
lint-staged
Environment
{
  "local_name": "lint-staged",
  "alias": false,
  "peer_metadata": null
}
^11.0.0runtime
lodash
Environment
{
  "local_name": "lodash",
  "alias": false,
  "peer_metadata": null
}
^4.17.19runtime
minimist
Environment
{
  "local_name": "minimist",
  "alias": false,
  "peer_metadata": null
}
^1.2.5runtime
mocha
Environment
{
  "local_name": "mocha",
  "alias": false,
  "peer_metadata": null
}
^8.4.0runtime
nyc
Environment
{
  "local_name": "nyc",
  "alias": false,
  "peer_metadata": null
}
^15.1.0runtime
prettier
Environment
{
  "local_name": "prettier",
  "alias": false,
  "peer_metadata": null
}
^2.3.0runtime
proxyquire
Environment
{
  "local_name": "proxyquire",
  "alias": false,
  "peer_metadata": null
}
^2.1.3runtime
sinon
Environment
{
  "local_name": "sinon",
  "alias": false,
  "peer_metadata": null
}
^11.1.1runtime
sinon-as-promised
Environment
{
  "local_name": "sinon-as-promised",
  "alias": false,
  "peer_metadata": null
}
^4.0.3runtime
sinon-chai
Environment
{
  "local_name": "sinon-chai",
  "alias": false,
  "peer_metadata": null
}
^3.5.0runtime
ts-node
Environment
{
  "local_name": "ts-node",
  "alias": false,
  "peer_metadata": null
}
^10.0.0runtime
typescript
Environment
{
  "local_name": "typescript",
  "alias": false,
  "peer_metadata": null
}
^4.3.2runtime
uuid
Environment
{
  "local_name": "uuid",
  "alias": false,
  "peer_metadata": null
}
^8.3.2runtime

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "integrity": "sha512-WABZWpmYZfB55Y0Wv8OKk0z3gaIbzmhX0rZ83DltrLI4GYoFTOKCISSJRcaENNlHuAtkTxj93uAcSJbyIknfDg==",
  "shasum": "c9b816b71da899a415d4d64f0d457c739adbee67",
  "tarball": "https://registry.npmjs.org/@0ti.me/ts-test-deps/-/ts-test-deps-0.1.6.tgz",
  "fileCount": 21,
  "unpackedSize": 16930,
  "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgspAKCRA9TVsSAnZWagAANj8QAINqmlCTvFHbHvmuiqLy\nyenIqK9nWtLT1D68SScbV4N1pUhtv9UEg7P2iP4jmPSAIlMPP5FIVgOvUyTu\n+brAtS+zffGjdJ1ipmx5Ly46vFeXmd3o5bG1wQO9WZFJR1A0hRSh4705lvBV\nT81zAxauBVVp6JMNtYgTw1ccCNoXhuFc19tc0Hm1rSnhBfUYhv2lUXEwtEN3\nH3YwYM7e4TzziFaYlt4e36Kfr6Y/iFb4EBDM4JYNO/gfoKLOc66bSvIdXHze\n3IBHhvR8Q/F+IozGawIH3J0vODO7/uP5r78V2cZD0Bu+xgEygbk3sU13oT7s\nge/uezD5wNmyFvdBrKTr6rxGV0APWlyBmMDCA/ND1TqEIL5MibF8x41vrfom\ncMBz8/za3KFG6cwaq+TASnXBQ2Sf7kT99e3pv/WfULQ4FG4139syAmi3GppG\nwV2OraHVkp2rpgCKJig+CF3c6TMF+y6iDfpLYmGtyGe4+w9VOT0qNdeATeVH\nNCUghOIqzALjPsJMFke+CZSPDFdS8oL0oxZhd9D3n2+Pr1N24EMvmLtAIvFK\nRj8Ov5+1KgGkhp4rZ9kjih7UxS77A2RgLYcvivW8eq0DuukjFGGgWoiagqgA\nwoudOhxe8cQwj7QUuTfTst3kA9OJlkskuN4Sf/ZfabfwqC8ndJRNeDRt3MrA\niNSm\r\n=/XBD\r\n-----END PGP SIGNATURE-----\r\n",
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEQCIFz14nQ3Y5VHmRh6JDGNNblNawqHkrEnRrxFZnMRPr6VAiA7wS6pJQe1Zf3t5ImpXfZUs8cjASmS+MRz2+yJTrynCg=="
    }
  ]
}

Repository

ACCESSIBLE
0ti.me/ts-test-deps

Shared repository data · GitLab

License detected in repository
Not collected
Contributor identities
1 · complete API traversal
Contributors · showing 1 of 1 collected
ContributorContributions
h32

Default-branch author identities; GitLab commit counts exclude merge commits.

Public sponsor counts have not been collected. These signals belong to the repository owner.

Downloads & popularity

1identities
Gauge · observed snapshots24 Oct 2026
10.50
2026-10-21: 1 · observed 2026-10-21T09:44:38.0371109Z2026-10-22: 1 · observed 2026-10-22T09:44:55.8207047Z2026-10-23: 1 · observed 2026-10-23T09:47:45.8322619Z2026-10-24: 1 · observed 2026-10-24T10:00:38.8306378Z
21 Oct24 Oct

gitlab · 4 observations shown. Missing days are unknown.

View observed values
Date / source periodValueObserved at
2026-10-2412026-10-24T10:00:38.8306378Z
2026-10-2312026-10-23T09:47:45.8322619Z
2026-10-2212026-10-22T09:44:55.8207047Z
2026-10-2112026-10-21T09:44:38.0371109Z

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 22:16 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:e5e20aab4750a1db94bfe0ab68a127be275bc76bdcf7b1cec709e2bc10aaf195

Other collected versions

0.2.023 Dec0.1.121 Sept0.1.1128 Aug0.1.1027 Aug0.1.931 May0.1.830 MayView all collected versions →