Reformated some file walker tests
This commit is contained in:
+20
-15
@@ -117,9 +117,10 @@ describe('Test index article reading', () => {
|
|||||||
`);
|
`);
|
||||||
fw.readIndexFile(file, 'custom_thumbnail', (err, info) => {
|
fw.readIndexFile(file, 'custom_thumbnail', (err, info) => {
|
||||||
expect(err).toBeNull();
|
expect(err).toBeNull();
|
||||||
expect(info).toBeDefined();
|
expect(info).toEqual({
|
||||||
expect(info.title).toBe('This is an awesome title !?¤');
|
title: 'This is an awesome title !?¤',
|
||||||
expect(info.thumbnail).toBe('./thumbnail.jpg');
|
thumbnail: './thumbnail.jpg'
|
||||||
|
});
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -132,9 +133,10 @@ describe('Test index article reading', () => {
|
|||||||
`);
|
`);
|
||||||
fw.readIndexFile(file, 'custom_thumbnail', (err, info) => {
|
fw.readIndexFile(file, 'custom_thumbnail', (err, info) => {
|
||||||
expect(err).toBeNull();
|
expect(err).toBeNull();
|
||||||
expect(info).toBeDefined();
|
expect(info).toEqual({
|
||||||
expect(info.title).not.toBeDefined();
|
title: undefined,
|
||||||
expect(info.thumbnail).toBe('./thumbnail.jpg');
|
thumbnail: './thumbnail.jpg'
|
||||||
|
});
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -143,9 +145,10 @@ describe('Test index article reading', () => {
|
|||||||
fs.writeFileSync(file, '#title');
|
fs.writeFileSync(file, '#title');
|
||||||
fw.readIndexFile(file, 'custom_thumbnail', (err, info) => {
|
fw.readIndexFile(file, 'custom_thumbnail', (err, info) => {
|
||||||
expect(err).toBeNull();
|
expect(err).toBeNull();
|
||||||
expect(info).toBeDefined();
|
expect(info).toEqual({
|
||||||
expect(info.title).toBe('title');
|
title: 'title',
|
||||||
expect(info.thumbnail).not.toBeDefined();
|
thumbnail: undefined
|
||||||
|
});
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -158,9 +161,10 @@ describe('Test index article reading', () => {
|
|||||||
`);
|
`);
|
||||||
fw.readIndexFile(file, 'thumbnail', (err, info) => {
|
fw.readIndexFile(file, 'thumbnail', (err, info) => {
|
||||||
expect(err).toBeNull();
|
expect(err).toBeNull();
|
||||||
expect(info).toBeDefined();
|
expect(info).toEqual({
|
||||||
expect(info.title).toBe('This is an awesome title !?¤');
|
title: 'This is an awesome title !?¤',
|
||||||
expect(info.thumbnail).not.toBeDefined();
|
thumbnail: undefined
|
||||||
|
});
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -174,9 +178,10 @@ describe('Test index article reading', () => {
|
|||||||
`);
|
`);
|
||||||
fw.readIndexFile(file, 'custom_thumbnail', (err, info) => {
|
fw.readIndexFile(file, 'custom_thumbnail', (err, info) => {
|
||||||
expect(err).toBeNull();
|
expect(err).toBeNull();
|
||||||
expect(info).toBeDefined();
|
expect(info).toEqual({
|
||||||
expect(info.title).toBe('This is an awesome title !?¤');
|
title: 'This is an awesome title !?¤',
|
||||||
expect(info.thumbnail).toBe('./thumbnail.jpg');
|
thumbnail: './thumbnail.jpg'
|
||||||
|
});
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user