-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.test.ts
More file actions
33 lines (29 loc) · 1.2 KB
/
index.test.ts
File metadata and controls
33 lines (29 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { fancy } from 'fancy-test';
import { expect } from 'chai';
import { $t, auditMsg, auditFixMsg } from '../../../src/messages';
describe('messages utility', () => {
describe('$t method', () => {
fancy
.stdout({ print: process.env.PRINT === 'true' || false })
.it('should replace the placeholder in the string with provided value', () => {
expect($t(auditMsg.AUDIT_START_SPINNER, { module: 'content-types' })).to.include(
auditMsg.AUDIT_START_SPINNER.replace(new RegExp(`{module}`, 'g'), 'content-types'),
);
});
});
describe('$t method', () => {
fancy
.stdout({ print: process.env.PRINT === 'true' || false })
.it('should return if the provided string is empty', () => {
expect($t('', {})).to.be.empty.string;
});
});
describe('typo regression: details not detials', () => {
it('ASSET_FIX and ENTRY_PUBLISH_DETAILS should contain "details"', () => {
expect(auditMsg.ENTRY_PUBLISH_DETAILS).to.include('details');
expect(auditMsg.ENTRY_PUBLISH_DETAILS).to.not.include('detials');
expect(auditFixMsg.ASSET_FIX).to.include('details');
expect(auditFixMsg.ASSET_FIX).to.not.include('detials');
});
});
});