-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
da6eb26
commit d702be7
Showing
7 changed files
with
28 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,23 @@ | ||
import * as allExports from '.'; | ||
|
||
const { CLIENT_NOT_FOUND, ...messages } = allExports; | ||
const { CLIENT_NOT_FOUND, OPERATIONS_TIMEOUT, ...messages } = allExports; | ||
|
||
describe('CLIENT_NOT_FOUND', () => { | ||
test('should return a string', () => { | ||
const namespace = 'client'; | ||
const namespace = 'name'; | ||
expect(CLIENT_NOT_FOUND(namespace)).toContain(namespace); | ||
expect(CLIENT_NOT_FOUND(namespace)).toContain('Redis'); | ||
expect(CLIENT_NOT_FOUND(namespace, false)).toContain(namespace); | ||
expect(CLIENT_NOT_FOUND(namespace, false)).toContain('Cluster'); | ||
}); | ||
}); | ||
|
||
describe('OPERATIONS_TIMEOUT', () => { | ||
test('should return a string', () => { | ||
expect(OPERATIONS_TIMEOUT(100)).toContain('100'); | ||
}); | ||
}); | ||
|
||
test('should be a string', () => { | ||
Object.values(messages).forEach(value => expect(typeof value).toBe('string')); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
export const MISSING_CONFIGURATION = `Asynchronous configurations are missing, you must provide one of 'useFactory', 'useClass', and 'useExisting'.`; | ||
export const MISSING_CONFIGURATION = | ||
'Asynchronous configurations are missing. Expected one of: `useFactory`, `useClass`, `useExisting`.'; | ||
export const CONNECTED_SUCCESSFULLY = `Connected successfully to the server`; | ||
export const CLIENT_NOT_FOUND = (namespace: string, isRedis = true): string => | ||
`${isRedis ? 'Redis' : 'Cluster'} client '${namespace}' not found in the application context.`; | ||
`${isRedis ? 'Redis' : 'Cluster'} client \`${namespace}\` not found in the application context.`; | ||
|
||
export const MISSING_CLIENT = `This client does not exist.`; | ||
export const NOT_RESPONSIVE = `This client is not responsive.`; | ||
export const ABNORMALLY_MEMORY_USAGE = `This client is using abnormally high memory.`; | ||
export const MISSING_CLIENT = 'Argument `client` is missing.'; | ||
export const MISSING_TYPE = 'Argument `type` is missing.'; | ||
export const NOT_RESPONSIVE = `The client is not responsive.`; | ||
export const ABNORMALLY_MEMORY_USAGE = `The client is using abnormally high memory.`; | ||
export const CANNOT_BE_READ = `Info cluster cannot be read.`; | ||
export const FAILED_CLUSTER_STATE = `Info cluster is not on OK state.`; | ||
export const FAILED_CLUSTER_STATE = `Info cluster is not in OK state.`; | ||
export const OPERATIONS_TIMEOUT = (timeout: number) => `Operations timed out after ${String(timeout)}ms.`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters