rizzo-next
Version:
The next generation of Lonely Planet's style guide and pattern library.
1,348 lines (1,347 loc) • 169 kB
JSON
{
"type": "Program",
"start": 0,
"end": 1533,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 47,
"column": 0
}
},
"sourceType": "module",
"body": [
{
"type": "ImportDeclaration",
"start": 0,
"end": 72,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 72
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 7,
"end": 19,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 19
}
},
"local": {
"type": "Identifier",
"start": 7,
"end": 19,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 19
}
},
"name": "HotelsWidget"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 25,
"end": 71,
"loc": {
"start": {
"line": 1,
"column": 25
},
"end": {
"line": 1,
"column": 71
}
},
"value": "../../../src/components/hotels/hotels_widget",
"rawValue": "../../../src/components/hotels/hotels_widget",
"raw": "\"../../../src/components/hotels/hotels_widget\""
}
},
{
"type": "ImportDeclaration",
"start": 73,
"end": 96,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 23
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 80,
"end": 81,
"loc": {
"start": {
"line": 2,
"column": 7
},
"end": {
"line": 2,
"column": 8
}
},
"local": {
"type": "Identifier",
"start": 80,
"end": 81,
"loc": {
"start": {
"line": 2,
"column": 7
},
"end": {
"line": 2,
"column": 8
}
},
"name": "$"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 87,
"end": 95,
"loc": {
"start": {
"line": 2,
"column": 14
},
"end": {
"line": 2,
"column": 22
}
},
"value": "jquery",
"rawValue": "jquery",
"raw": "\"jquery\""
}
},
{
"type": "VariableDeclaration",
"start": 98,
"end": 172,
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 4,
"column": 74
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 102,
"end": 171,
"loc": {
"start": {
"line": 4,
"column": 4
},
"end": {
"line": 4,
"column": 73
}
},
"id": {
"type": "Identifier",
"start": 102,
"end": 116,
"loc": {
"start": {
"line": 4,
"column": 4
},
"end": {
"line": 4,
"column": 18
}
},
"name": "hotelsTemplate"
},
"init": {
"type": "CallExpression",
"start": 119,
"end": 171,
"loc": {
"start": {
"line": 4,
"column": 21
},
"end": {
"line": 4,
"column": 73
}
},
"callee": {
"type": "Identifier",
"start": 119,
"end": 126,
"loc": {
"start": {
"line": 4,
"column": 21
},
"end": {
"line": 4,
"column": 28
}
},
"name": "require"
},
"arguments": [
{
"type": "Literal",
"start": 127,
"end": 170,
"loc": {
"start": {
"line": 4,
"column": 29
},
"end": {
"line": 4,
"column": 72
}
},
"value": "../../../src/components/hotels/hotels.hbs",
"rawValue": "../../../src/components/hotels/hotels.hbs",
"raw": "\"../../../src/components/hotels/hotels.hbs\""
}
]
}
}
],
"kind": "let"
},
{
"type": "VariableDeclaration",
"start": 174,
"end": 222,
"loc": {
"start": {
"line": 6,
"column": 0
},
"end": {
"line": 8,
"column": 3
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 178,
"end": 221,
"loc": {
"start": {
"line": 6,
"column": 4
},
"end": {
"line": 8,
"column": 2
}
},
"id": {
"type": "Identifier",
"start": 178,
"end": 182,
"loc": {
"start": {
"line": 6,
"column": 4
},
"end": {
"line": 6,
"column": 8
}
},
"name": "html"
},
"init": {
"type": "CallExpression",
"start": 185,
"end": 221,
"loc": {
"start": {
"line": 6,
"column": 11
},
"end": {
"line": 8,
"column": 2
}
},
"callee": {
"type": "Identifier",
"start": 185,
"end": 199,
"loc": {
"start": {
"line": 6,
"column": 11
},
"end": {
"line": 6,
"column": 25
}
},
"name": "hotelsTemplate"
},
"arguments": [
{
"type": "ObjectExpression",
"start": 200,
"end": 220,
"loc": {
"start": {
"line": 6,
"column": 26
},
"end": {
"line": 8,
"column": 1
}
},
"properties": [
{
"type": "Property",
"start": 204,
"end": 218,
"loc": {
"start": {
"line": 7,
"column": 2
},
"end": {
"line": 7,
"column": 16
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 204,
"end": 212,
"loc": {
"start": {
"line": 7,
"column": 2
},
"end": {
"line": 7,
"column": 10
}
},
"name": "lodgings"
},
"value": {
"type": "Literal",
"start": 214,
"end": 218,
"loc": {
"start": {
"line": 7,
"column": 12
},
"end": {
"line": 7,
"column": 16
}
},
"value": true,
"rawValue": true,
"raw": "true"
},
"kind": "init"
}
]
}
]
}
}
],
"kind": "let",
"trailingComments": [
{
"type": "Block",
"value": "* @test {HotelsWidget} ",
"start": 225,
"end": 252,
"loc": {
"start": {
"line": 11,
"column": 0
},
"end": {
"line": 11,
"column": 27
}
},
"range": [
225,
252
]
}
]
},
{
"type": "ExpressionStatement",
"start": 253,
"end": 1532,
"loc": {
"start": {
"line": 12,
"column": 0
},
"end": {
"line": 46,
"column": 3
}
},
"expression": {
"type": "CallExpression",
"start": 253,
"end": 1531,
"loc": {
"start": {
"line": 12,
"column": 0
},
"end": {
"line": 46,
"column": 2
}
},
"callee": {
"type": "Identifier",
"start": 253,
"end": 261,
"loc": {
"start": {
"line": 12,
"column": 0
},
"end": {
"line": 12,
"column": 8
}
},
"name": "describe",
"leadingComments": null
},
"arguments": [
{
"type": "Literal",
"start": 262,
"end": 277,
"loc": {
"start": {
"line": 12,
"column": 9
},
"end": {
"line": 12,
"column": 24
}
},
"value": "hotels widget",
"rawValue": "hotels widget",
"raw": "\"hotels widget\""
},
{
"type": "ArrowFunctionExpression",
"start": 279,
"end": 1530,
"loc": {
"start": {
"line": 12,
"column": 26
},
"end": {
"line": 46,
"column": 1
}
},
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 285,
"end": 1530,
"loc": {
"start": {
"line": 12,
"column": 32
},
"end": {
"line": 46,
"column": 1
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 289,
"end": 536,
"loc": {
"start": {
"line": 13,
"column": 2
},
"end": {
"line": 18,
"column": 5
}
},
"expression": {
"type": "CallExpression",
"start": 289,
"end": 535,
"loc": {
"start": {
"line": 13,
"column": 2
},
"end": {
"line": 18,
"column": 4
}
},
"callee": {
"type": "Identifier",
"start": 289,
"end": 291,
"loc": {
"start": {
"line": 13,
"column": 2
},
"end": {
"line": 13,
"column": 4
}
},
"name": "it"
},
"arguments": [
{
"type": "Literal",
"start": 292,
"end": 320,
"loc": {
"start": {
"line": 13,
"column": 5
},
"end": {
"line": 13,
"column": 33
}
},
"value": "should add 1 day to a date",
"rawValue": "should add 1 day to a date",
"raw": "\"should add 1 day to a date\""
},
{
"type": "ArrowFunctionExpression",
"start": 322,
"end": 534,
"loc": {
"start": {
"line": 13,
"column": 35
},
"end": {
"line": 18,
"column": 3
}
},
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 328,
"end": 534,
"loc": {
"start": {
"line": 13,
"column": 41
},
"end": {
"line": 18,
"column": 3
}
},
"body": [
{
"type": "VariableDeclaration",
"start": 334,
"end": 415,
"loc": {
"start": {
"line": 14,
"column": 4
},
"end": {
"line": 14,
"column": 85
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 338,
"end": 414,
"loc": {
"start": {
"line": 14,
"column": 8
},
"end": {
"line": 14,
"column": 84
}
},
"id": {
"type": "Identifier",
"start": 338,
"end": 342,
"loc": {
"start": {
"line": 14,
"column": 8
},
"end": {
"line": 14,
"column": 12
}
},
"name": "date"
},
"init": {
"type": "CallExpression",
"start": 345,
"end": 414,
"loc": {
"start": {
"line": 14,
"column": 15
},
"end": {
"line": 14,
"column": 84
}
},
"callee": {
"type": "MemberExpression",
"start": 345,
"end": 376,
"loc": {
"start": {
"line": 14,
"column": 15
},
"end": {
"line": 14,
"column": 46
}
},
"object": {
"type": "MemberExpression",
"start": 345,
"end": 367,
"loc": {
"start": {
"line": 14,
"column": 15
},
"end": {
"line": 14,
"column": 37
}
},
"object": {
"type": "Identifier",
"start": 345,
"end": 357,
"loc": {
"start": {
"line": 14,
"column": 15
},
"end": {
"line": 14,
"column": 27
}
},
"name": "HotelsWidget"
},
"property": {
"type": "Identifier",
"start": 358,
"end": 367,
"loc": {
"start": {
"line": 14,
"column": 28
},
"end": {
"line": 14,
"column": 37
}
},
"name": "prototype"
},
"computed": false
},
"property": {
"type": "Identifier",
"start": 368,
"end": 376,
"loc": {
"start": {
"line": 14,
"column": 38
},
"end": {
"line": 14,
"column": 46
}
},
"name": "nextDate"
},
"computed": false
},
"arguments": [
{
"type": "NewExpression",
"start": 377,
"end": 413,
"loc": {
"start": {
"line": 14,
"column": 47
},
"end": {
"line": 14,
"column": 83
}
},
"callee": {
"type": "Identifier",
"start": 381,
"end": 385,
"loc": {
"start": {
"line": 14,
"column": 51
},
"end": {
"line": 14,
"column": 55
}
},
"name": "Date"
},
"arguments": [
{
"type": "Literal",
"start": 386,
"end": 412,
"loc": {
"start": {
"line": 14,
"column": 56
},
"end": {
"line": 14,
"column": 82
}
},
"value": "January 1, 2015 00:00:00",
"rawValue": "January 1, 2015 00:00:00",
"raw": "\"January 1, 2015 00:00:00\""
}
]
}
]
}
}
],
"kind": "let",
"trailingComments": [
{
"type": "CommentLine",
"value": " 5 would be because January 1 was a Wednesday(4), so + 1 is Thursday(5)",
"start": 421,
"end": 494,
"loc": {
"start": {
"line": 16,
"column": 4
},
"end": {
"line": 16,
"column": 77
}
},
"range": [
421,
494
]
}
]
},
{
"type": "ExpressionStatement",
"start": 499,
"end": 530,
"loc": {
"start": {
"line": 17,
"column": 4
},
"end": {
"line": 17,
"column": 35
}
},
"expression": {
"type": "CallExpression",
"start": 499,
"end": 529,
"loc": {
"start": {
"line": 17,
"column": 4
},
"end": {
"line": 17,
"column": 34
}
},
"callee": {
"type": "MemberExpression",
"start": 499,
"end": 526,
"loc": {
"start": {
"line": 17,
"column": 4
},
"end": {
"line": 17,
"column": 31
}
},
"object": {
"type": "MemberExpression",
"start": 499,
"end": 523,
"loc": {
"start": {
"line": 17,
"column": 4
},
"end": {
"line": 17,
"column": 28
}
},
"object": {
"type": "CallExpression",
"start": 499,
"end": 520,
"loc": {
"start": {
"line": 17,
"column": 4
},
"end": {
"line": 17,
"column": 25
}
},
"callee": {
"type": "Identifier",
"start": 499,
"end": 505,
"loc": {
"start": {
"line": 17,
"column": 4
},
"end": {
"line": 17,
"column": 10
}
},
"name": "expect",
"leadingComments": null
},
"arguments": [
{
"type": "CallExpression",
"start": 506,
"end": 519,
"loc": {
"start": {
"line": 17,
"column": 11
},
"end": {
"line": 17,
"column": 24
}
},
"callee": {
"type": "MemberExpression",
"start": 506,
"end": 517,
"loc": {
"start": {
"line": 17,
"column": 11
},
"end": {
"line": 17,
"column": 22
}
},
"object": {
"type": "Identifier",
"start": 506,
"end": 510,
"loc": {
"start": {
"line": 17,
"column": 11
},
"end": {
"line": 17,
"column": 15
}
},
"name": "date"
},
"property": {
"type": "Identifier",
"start": 511,
"end": 517,
"loc": {
"start": {
"line": 17,
"column": 16
},
"end": {
"line": 17,
"column": 22
}
},
"name": "getDay"
},
"computed": false
},
"arguments": []
}
],
"leadingComments": null
},
"property": {
"type": "Identifier",
"start": 521,
"end": 523,
"loc": {
"start": {
"line": 17,
"column": 26
},
"end": {
"line": 17,
"column": 28
}
},
"name": "to"
},
"computed": false,
"leadingComments": null
},
"property": {
"type": "Identifier",
"start": 524,
"end": 526,
"loc": {
"start": {
"line": 17,
"column": 29
},
"end": {
"line": 17,
"column": 31
}
},
"name": "be"
},
"computed": false,
"leadingComments": null
},
"arguments": [
{
"type": "Literal",
"start": 527,
"end": 528,
"loc": {
"start": {
"line": 17,
"column": 32
},
"end": {
"line": 17,
"column": 33
}
},
"value": 5,
"rawValue": 5,
"raw": "5"
}
],
"leadingComments": null
},
"leadingComments": [
{
"type": "CommentLine",
"value": " 5 would be because January 1 was a Wednesday(4), so + 1 is Thursday(5)",
"start": 421,
"end": 494,
"loc": {
"start": {
"line": 16,
"column": 4
},
"end": {
"line": 16,
"column": 77
}
},
"range": [
421,
494
]
}
]
}
]
}
}
],
"_esdocTestId": 7,
"_esdocTestName": "it7"
}
},
{
"type": "ExpressionStatement",
"start": 540,
"end": 1048,
"loc": {
"start": {
"line": 20,
"column": 2
},
"end": {
"line": 32,
"column": 5
}
},
"expression": {
"type": "CallExpression",
"start": 540,
"end": 1047,
"loc": {
"start": {
"line": 20,
"column": 2
},
"end": {
"line": 32,
"column": 4
}
},
"callee": {
"type": "Identifier",
"start": 540,
"end": 542,
"loc": {
"start": {
"line": 20,
"column": 2
},
"end": {
"line": 20,
"column": 4
}
},
"name": "it"
},
"arguments": [
{
"type": "Literal",
"start": 543,
"end": 622,
"loc": {
"start": {
"line": 20,
"column": 5
},
"end": {
"line": 20,
"column": 84
}
},
"value": "should change the endDate if the startDate gets changed to after the end date",
"rawValue": "should change the endDate if the startDate gets changed to after the end date",
"raw": "\"should change the endDate if the startDate gets changed to after the end date\""
},
{
"type": "ArrowFunctionExpression",
"start": 624,
"end": 1046,
"loc": {
"start": {
"line": 20,
"column": 86
},
"end": {
"line": 32,
"column": 3
}
},
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 630,
"end": 1046,
"loc": {
"start": {
"line": 20,
"column": 92
},
"end": {
"line": 32,
"column": 3
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 636,
"end": 688,
"loc": {
"start": {
"line": 21,
"column": 4
},
"end": {
"line": 21,
"column": 56
}
},
"expression": {
"type": "CallExpression",
"start": 636,
"end": 687,
"loc": {
"start": {
"line": 21,
"column": 4
},
"end": {
"line": 21,
"column": 55
}
},
"callee": {
"type": "MemberExpression",
"start": 636,
"end": 646,
"loc": {
"start": {
"line": 21,
"column": 4
},
"end": {
"line": 21,
"column": 14
}
},
"object": {
"type": "Identifier",
"start": 636,
"end": 641,
"loc": {
"start": {
"line": 21,
"column": 4
},
"end": {
"line": 21,
"column": 9
}
},
"name": "sinon"
},
"property": {
"type": "Identifier",
"start": 642,
"end": 646,
"loc": {
"start": {
"line": 21,
"column": 10
},
"end": {
"line": 21,
"column": 14
}
},
"name": "stub"
},
"computed": false
},
"arguments": [
{
"type": "MemberExpression",
"start": 647,
"end": 669,
"loc": {
"start": {
"line": 21,
"column": 15
},
"end": {
"line": 21,
"column": 37
}
},
"object": {
"type": "Identifier",
"start": 647,
"end": 659,
"loc": {
"start": {
"line": 21,
"column": 15
},
"end": {
"line": 21,
"column": 27
}
},
"name": "HotelsWidget"
},
"property": {
"type": "Identifier",
"start": 660,
"end": 669,
"loc": {
"start": {
"line": 21,
"column": 28
},
"end": {
"line": 21,
"column": 37
}
},
"name": "prototype"
},
"computed": false
},
{
"type": "Literal",
"start": 671,
"end": 686,
"loc": {
"start": {
"line": 21,
"column": 39
},
"end": {
"line": 21,
"column": 54
}
},
"value": "updateEndDate",
"rawValue": "updateEndDate",
"raw": "\"updateEndDate\""
}
]
}
},
{
"type": "VariableDeclaration",
"start": 694,
"end": 834,
"loc": {
"start": {
"line": 23,
"column": 4
},
"end": {
"line": 26,
"column": 6
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 698,
"end": 833,
"loc": {