test: update parser tests and snapshots
This commit is contained in:
committed by
Mrugesh Mohapatra
parent
0f3f27287d
commit
6e091a7cdb
@@ -3,6 +3,7 @@ const isArray = require('lodash/isArray');
|
||||
|
||||
const mockAST = require('./fixtures/challenge-html-ast.json');
|
||||
const { challengeSeedToData } = require('./challengeSeed-to-data');
|
||||
const { isObject } = require('lodash');
|
||||
|
||||
describe('challengeSeed-to-data plugin', () => {
|
||||
const plugin = challengeSeedToData();
|
||||
@@ -21,9 +22,9 @@ describe('challengeSeed-to-data plugin', () => {
|
||||
expect('files' in file.data).toBe(true);
|
||||
});
|
||||
|
||||
it('ensures that the `files` property is an array', () => {
|
||||
it('ensures that the `files` property is an object', () => {
|
||||
plugin(mockAST, file);
|
||||
expect(Array.isArray(file.data.files)).toBe(true);
|
||||
expect(isObject(file.data.files)).toBe(true);
|
||||
});
|
||||
|
||||
it('adds test objects to the files array following a schema', () => {
|
||||
@@ -32,7 +33,7 @@ describe('challengeSeed-to-data plugin', () => {
|
||||
const {
|
||||
data: { files }
|
||||
} = file;
|
||||
const testObject = files[0];
|
||||
const testObject = files.indexjs;
|
||||
expect(Object.keys(testObject).length).toEqual(7);
|
||||
expect(testObject).toHaveProperty('key');
|
||||
expect(typeof testObject['key']).toBe('string');
|
||||
|
Reference in New Issue
Block a user