wip
This commit is contained in:
parent
7eae722041
commit
5ae916bad4
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@apihub24/password-hasher",
|
||||
"version": "1.0.4",
|
||||
"version": "1.0.5",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@apihub24/password-hasher",
|
||||
"version": "1.0.4",
|
||||
"version": "1.0.5",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@apihub24/token-authentication": "^1.0.0",
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@apihub24/password-hasher",
|
||||
"version": "1.0.4",
|
||||
"version": "1.0.5",
|
||||
"description": "",
|
||||
"main": "dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { ConfigModule } from "@nestjs/config";
|
||||
import { Test, TestingModule } from "@nestjs/testing";
|
||||
import { PasswordHashService } from "./password.hash.service";
|
||||
import { PasswordHashService } from "./";
|
||||
|
||||
describe("Password Service Tests", () => {
|
||||
let module: TestingModule | null = null;
|
||||
|
||||
@ -1,5 +1,8 @@
|
||||
import { Test, TestingModule } from "@nestjs/testing";
|
||||
import { PasswordHasherModule } from "./password.hasher.module";
|
||||
import {
|
||||
APIHUB24_PASSWORD_SERVICE_INJECTION_KEY,
|
||||
PasswordHasherModule,
|
||||
} from "./";
|
||||
|
||||
describe("PasswordHasherModule Tests", () => {
|
||||
let module: TestingModule | null = null;
|
||||
@ -10,6 +13,10 @@ describe("PasswordHasherModule Tests", () => {
|
||||
}).compile();
|
||||
});
|
||||
|
||||
it("should export injection Key", () => {
|
||||
expect(APIHUB24_PASSWORD_SERVICE_INJECTION_KEY).toBeDefined();
|
||||
});
|
||||
|
||||
it("should get PasswordHasherService by injection Key @apihub24/password_service", () => {
|
||||
expect(module).toBeDefined();
|
||||
const service = module?.get("@apihub24/password_service");
|
||||
|
||||
@ -1,13 +1,16 @@
|
||||
import { DynamicModule, Module } from '@nestjs/common';
|
||||
import { PasswordHashService } from './password.hash.service';
|
||||
import { ConfigModule } from '@nestjs/config';
|
||||
import { DynamicModule, Module } from "@nestjs/common";
|
||||
import { PasswordHashService } from "./password.hash.service";
|
||||
import { ConfigModule } from "@nestjs/config";
|
||||
|
||||
export const APIHUB24_PASSWORD_SERVICE_INJECTION_KEY =
|
||||
"@apihub24/password_service";
|
||||
|
||||
@Module({})
|
||||
export class PasswordHasherModule {
|
||||
static forRoot(): DynamicModule {
|
||||
const providers = [
|
||||
{
|
||||
provide: '@apihub24/password_service',
|
||||
provide: APIHUB24_PASSWORD_SERVICE_INJECTION_KEY,
|
||||
useClass: PasswordHashService,
|
||||
},
|
||||
];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user