Skip to content

Commit dd78a8d

Browse files
authored
feat: add testing-utilities package (#214)
* feat: add testing-utilities package * chore: remove import * test(testing-utilities): add small test * chore: update readme
1 parent 6ac6a2f commit dd78a8d

File tree

13 files changed

+223
-0
lines changed

13 files changed

+223
-0
lines changed

tools/testing-utilities/.babelrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"presets": [
3+
["@verdaccio"]
4+
]
5+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules
2+
coverage/
3+
lib/
4+
.nyc_output
5+
tests-report/
6+
build/
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"rules": {
3+
"@typescript-eslint/no-use-before-define": "off"
4+
}
5+
}

tools/testing-utilities/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
lib/

tools/testing-utilities/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019 Verdaccio
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

tools/testing-utilities/README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Testing Utilities
2+
3+
[![CircleCI](https://circleci.com/gh/verdaccio/testing-utilities.svg?style=svg)](https://circleci.com/gh/verdaccio/@verdaccio/testing-utilities)
4+
[![codecov](https://codecov.io/gh/verdaccio/testing-utilities/branch/master/graph/badge.svg)](https://codecov.io/gh/verdaccio/testing-utilities)
5+
[![verdaccio (latest)](https://img.shields.io/npm/v/@verdaccio/testing-utilities/latest.svg)](https://www.npmjs.com/package/@verdaccio/testing-utilities)
6+
[![backers](https://opencollective.com/verdaccio/tiers/backer/badge.svg?label=Backer&color=brightgreen)](https://opencollective.com/verdaccio)
7+
[![discord](https://img.shields.io/discord/388674437219745793.svg)](http://chat.verdaccio.org/)
8+
![MIT](https://img.shields.io/github/license/mashape/apistatus.svg)
9+
[![node](https://img.shields.io/node/v/@verdaccio/testing-utilities/latest.svg)](https://www.npmjs.com/package/@verdaccio/testing-utilities)
10+
11+
12+
This project provides a list of helpers to be reused for unit testing.
13+
14+
## API
15+
16+
- `generatePackageBody()`
17+
- `generateVersion()`
18+
19+
These methods are intended to generate package metadata for multiples usage in testing.
20+
21+
## License
22+
23+
MIT (http://www.opensource.org/licenses/mit-license.php)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module.exports = {
2+
name: 'verdaccio-streams',
3+
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
4+
transform: {
5+
'^.+\\.(js|jsx|ts|tsx)$': 'babel-jest',
6+
},
7+
verbose: true,
8+
collectCoverage: true,
9+
coveragePathIgnorePatterns: ['node_modules', 'fixtures'],
10+
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
require.requireActual('babel/polyfill');
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"name": "@verdaccio/testing-utilities",
3+
"version": "8.2.0-next.0",
4+
"description": "Utils for Verdaccio",
5+
"keywords": [
6+
"verdaccio",
7+
"package",
8+
"utils",
9+
"testing"
10+
],
11+
"author": "Juan Picado <juanpicado19@gmail.com>",
12+
"license": "MIT",
13+
"homepage": "https://verdaccio.org",
14+
"repository": {
15+
"type": "git",
16+
"url": "https://github.com/verdaccio/monorepo",
17+
"directory": "core/utils"
18+
},
19+
"bugs": {
20+
"url": "https://github.com/verdaccio/monorepo/issues"
21+
},
22+
"publishConfig": {
23+
"access": "public"
24+
},
25+
"main": "lib/index.js",
26+
"types": "lib/index.d.ts",
27+
"files": [
28+
"lib"
29+
],
30+
"engines": {
31+
"node": ">=8",
32+
"npm": ">=5"
33+
},
34+
"devDependencies": {
35+
"@verdaccio/babel-preset": "^8.2.0-next.0",
36+
"@verdaccio/eslint-config": "^8.2.0-next.0",
37+
"@verdaccio/types": "^8.1.0"
38+
},
39+
"scripts": {
40+
"build": "npm run build:types && npm run build:js",
41+
"build:js": "babel src --out-dir lib --extensions \\\".ts,.tsx\\\" --source-maps inline",
42+
"build:types": "tsc --emitDeclarationOnly",
43+
"coverage:publish": "codecov --root=../../ -F core",
44+
"lint": "eslint \"**/*.{js,ts}\"",
45+
"lint:stage": "lint-staged",
46+
"test": "jest",
47+
"type-check": "tsc --noEmit",
48+
"type-check:watch": "npm run type-check -- --watch"
49+
}
50+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './package-generator';

0 commit comments

Comments
 (0)