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