-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtestArray.js
43 lines (40 loc) · 1.12 KB
/
testArray.js
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
34
35
36
37
38
39
40
41
42
43
let assert = require('assert');
let moment = require('moment')
let { Tucson, Config } = require('../lib/index')
describe('Check array', () => {
const dummyUnderscoreJson = {
id: 1,
company_id: 1,
title: 'Software engineer',
description: 'Job desc',
location: 'Anywhere',
timezone: 'AZ',
contact_email: '[email protected]',
tags: [],
published: true,
company: [
{
company_name: 'remozine',
company_url: 'www.remozine.com',
company_logo_url: null
},
{
company_name: 'google',
company_url: 'google.com',
company_logo_url: null
}
]
}
let formedResult = {}
let cctucson = new Tucson(new Config('camelCase'))
before(() => {
cctucson.formed(dummyUnderscoreJson, {}, formedResult)
})
describe('check array values', () => {
it('data inside array value should be converted ', function() {
assert(formedResult["company"] instanceof Array === true)
assert(formedResult["company"][0]["companyName"] === "remozine")
assert(formedResult["company"][1]["companyName"] === "google")
});
});
});