Add unit tests for models and services
- Implemented unit tests for the Package model, covering methods such as generateId, findById, findByName, and version management. - Created unit tests for the Repository model, including repository creation, name validation, and retrieval methods. - Added tests for the Session model, focusing on session creation, validation, and invalidation. - Developed unit tests for the User model, ensuring user creation, password hashing, and retrieval methods function correctly. - Implemented AuthService tests, validating login, token refresh, and session management. - Added TokenService tests, covering token creation, validation, and revocation processes.
This commit is contained in:
10
test/fixtures/npm/@stack-test/demo-package/README.md
vendored
Normal file
10
test/fixtures/npm/@stack-test/demo-package/README.md
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
# @stack-test/demo-package
|
||||
|
||||
Demo package for Stack.Gallery Registry e2e tests.
|
||||
|
||||
## Usage
|
||||
|
||||
```javascript
|
||||
const demo = require('@stack-test/demo-package');
|
||||
console.log(demo.greet('World')); // Hello, World!
|
||||
```
|
||||
9
test/fixtures/npm/@stack-test/demo-package/index.js
vendored
Normal file
9
test/fixtures/npm/@stack-test/demo-package/index.js
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
/**
|
||||
* Demo package for Stack.Gallery Registry e2e tests
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
name: 'demo-package',
|
||||
greet: (name) => `Hello, ${name}!`,
|
||||
version: () => require('./package.json').version
|
||||
};
|
||||
13
test/fixtures/npm/@stack-test/demo-package/package.json
vendored
Normal file
13
test/fixtures/npm/@stack-test/demo-package/package.json
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "@stack-test/demo-package",
|
||||
"version": "1.0.0",
|
||||
"description": "Demo package for Stack.Gallery Registry e2e tests",
|
||||
"main": "index.js",
|
||||
"author": "Stack.Gallery Test <test@stack.gallery>",
|
||||
"license": "MIT",
|
||||
"keywords": ["demo", "test", "stack-gallery"],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/stack-gallery/demo-package"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user