Skip to content

Commit

Permalink
update test fixutres
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed Jun 14, 2022
1 parent 28bf93c commit a05499e
Show file tree
Hide file tree
Showing 18 changed files with 173 additions and 169 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as foo } from "foo.json" assert { type: "json", type: "html" };
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{
"type": "File",
"start":0,"end":80,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":80,"index":80}},
"errors": [
"SyntaxError: Duplicate key \"type\" is not allowed in module attributes. (1:65)"
],
"program": {
"type": "Program",
"start":0,"end":80,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":80,"index":80}},
"sourceType": "module",
"interpreter": null,
"body": [
{
"type": "ExportNamedDeclaration",
"start":0,"end":80,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":80,"index":80}},
"specifiers": [
{
"type": "ExportSpecifier",
"start":9,"end":23,"loc":{"start":{"line":1,"column":9,"index":9},"end":{"line":1,"column":23,"index":23}},
"local": {
"type": "Identifier",
"start":9,"end":16,"loc":{"start":{"line":1,"column":9,"index":9},"end":{"line":1,"column":16,"index":16},"identifierName":"default"},
"name": "default"
},
"exported": {
"type": "Identifier",
"start":20,"end":23,"loc":{"start":{"line":1,"column":20,"index":20},"end":{"line":1,"column":23,"index":23},"identifierName":"foo"},
"name": "foo"
}
}
],
"source": {
"type": "StringLiteral",
"start":31,"end":41,"loc":{"start":{"line":1,"column":31,"index":31},"end":{"line":1,"column":41,"index":41}},
"extra": {
"rawValue": "foo.json",
"raw": "\"foo.json\""
},
"value": "foo.json"
},
"declaration": null,
"assertions": [
{
"type": "ImportAttribute",
"start":51,"end":63,"loc":{"start":{"line":1,"column":51,"index":51},"end":{"line":1,"column":63,"index":63}},
"key": {
"type": "Identifier",
"start":51,"end":55,"loc":{"start":{"line":1,"column":51,"index":51},"end":{"line":1,"column":55,"index":55},"identifierName":"type"},
"name": "type"
},
"value": {
"type": "StringLiteral",
"start":57,"end":63,"loc":{"start":{"line":1,"column":57,"index":57},"end":{"line":1,"column":63,"index":63}},
"extra": {
"rawValue": "json",
"raw": "\"json\""
},
"value": "json"
}
},
{
"type": "ImportAttribute",
"start":65,"end":77,"loc":{"start":{"line":1,"column":65,"index":65},"end":{"line":1,"column":77,"index":77}},
"key": {
"type": "Identifier",
"start":65,"end":69,"loc":{"start":{"line":1,"column":65,"index":65},"end":{"line":1,"column":69,"index":69},"identifierName":"type"},
"name": "type"
},
"value": {
"type": "StringLiteral",
"start":71,"end":77,"loc":{"start":{"line":1,"column":71,"index":71},"end":{"line":1,"column":77,"index":77}},
"extra": {
"rawValue": "html",
"raw": "\"html\""
},
"value": "html"
}
}
]
}
],
"directives": []
}
}
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
import foo from "foo" assert { type: "json", }
export { foo } from "foo" assert { type: "json", }
export { default as foo } from "foo" assert { type: "json", }
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"type": "File",
"start":0,"end":97,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":2,"column":50,"index":97}},
"start":0,"end":108,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":2,"column":61,"index":108}},
"program": {
"type": "Program",
"start":0,"end":97,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":2,"column":50,"index":97}},
"start":0,"end":108,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":2,"column":61,"index":108}},
"sourceType": "module",
"interpreter": null,
"body": [
Expand Down Expand Up @@ -53,26 +53,26 @@
},
{
"type": "ExportNamedDeclaration",
"start":47,"end":97,"loc":{"start":{"line":2,"column":0,"index":47},"end":{"line":2,"column":50,"index":97}},
"start":47,"end":108,"loc":{"start":{"line":2,"column":0,"index":47},"end":{"line":2,"column":61,"index":108}},
"specifiers": [
{
"type": "ExportSpecifier",
"start":56,"end":59,"loc":{"start":{"line":2,"column":9,"index":56},"end":{"line":2,"column":12,"index":59}},
"start":56,"end":70,"loc":{"start":{"line":2,"column":9,"index":56},"end":{"line":2,"column":23,"index":70}},
"local": {
"type": "Identifier",
"start":56,"end":59,"loc":{"start":{"line":2,"column":9,"index":56},"end":{"line":2,"column":12,"index":59},"identifierName":"foo"},
"name": "foo"
"start":56,"end":63,"loc":{"start":{"line":2,"column":9,"index":56},"end":{"line":2,"column":16,"index":63},"identifierName":"default"},
"name": "default"
},
"exported": {
"type": "Identifier",
"start":56,"end":59,"loc":{"start":{"line":2,"column":9,"index":56},"end":{"line":2,"column":12,"index":59},"identifierName":"foo"},
"start":67,"end":70,"loc":{"start":{"line":2,"column":20,"index":67},"end":{"line":2,"column":23,"index":70},"identifierName":"foo"},
"name": "foo"
}
}
],
"source": {
"type": "StringLiteral",
"start":67,"end":72,"loc":{"start":{"line":2,"column":20,"index":67},"end":{"line":2,"column":25,"index":72}},
"start":78,"end":83,"loc":{"start":{"line":2,"column":31,"index":78},"end":{"line":2,"column":36,"index":83}},
"extra": {
"rawValue": "foo",
"raw": "\"foo\""
Expand All @@ -83,15 +83,15 @@
"assertions": [
{
"type": "ImportAttribute",
"start":82,"end":94,"loc":{"start":{"line":2,"column":35,"index":82},"end":{"line":2,"column":47,"index":94}},
"start":93,"end":105,"loc":{"start":{"line":2,"column":46,"index":93},"end":{"line":2,"column":58,"index":105}},
"key": {
"type": "Identifier",
"start":82,"end":86,"loc":{"start":{"line":2,"column":35,"index":82},"end":{"line":2,"column":39,"index":86},"identifierName":"type"},
"start":93,"end":97,"loc":{"start":{"line":2,"column":46,"index":93},"end":{"line":2,"column":50,"index":97},"identifierName":"type"},
"name": "type"
},
"value": {
"type": "StringLiteral",
"start":88,"end":94,"loc":{"start":{"line":2,"column":41,"index":88},"end":{"line":2,"column":47,"index":94}},
"start":99,"end":105,"loc":{"start":{"line":2,"column":52,"index":99},"end":{"line":2,"column":58,"index":105}},
"extra": {
"rawValue": "json",
"raw": "\"json\""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { x } from "foo" assert
export { default as x } from "foo" assert
{ type: "json" }
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
{
"type": "File",
"start":0,"end":47,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":2,"column":16,"index":47}},
"start":0,"end":58,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":2,"column":16,"index":58}},
"program": {
"type": "Program",
"start":0,"end":47,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":2,"column":16,"index":47}},
"start":0,"end":58,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":2,"column":16,"index":58}},
"sourceType": "module",
"interpreter": null,
"body": [
{
"type": "ExportNamedDeclaration",
"start":0,"end":47,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":2,"column":16,"index":47}},
"start":0,"end":58,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":2,"column":16,"index":58}},
"specifiers": [
{
"type": "ExportSpecifier",
"start":9,"end":10,"loc":{"start":{"line":1,"column":9,"index":9},"end":{"line":1,"column":10,"index":10}},
"start":9,"end":21,"loc":{"start":{"line":1,"column":9,"index":9},"end":{"line":1,"column":21,"index":21}},
"local": {
"type": "Identifier",
"start":9,"end":10,"loc":{"start":{"line":1,"column":9,"index":9},"end":{"line":1,"column":10,"index":10},"identifierName":"x"},
"name": "x"
"start":9,"end":16,"loc":{"start":{"line":1,"column":9,"index":9},"end":{"line":1,"column":16,"index":16},"identifierName":"default"},
"name": "default"
},
"exported": {
"type": "Identifier",
"start":9,"end":10,"loc":{"start":{"line":1,"column":9,"index":9},"end":{"line":1,"column":10,"index":10},"identifierName":"x"},
"start":20,"end":21,"loc":{"start":{"line":1,"column":20,"index":20},"end":{"line":1,"column":21,"index":21},"identifierName":"x"},
"name": "x"
}
}
],
"source": {
"type": "StringLiteral",
"start":18,"end":23,"loc":{"start":{"line":1,"column":18,"index":18},"end":{"line":1,"column":23,"index":23}},
"start":29,"end":34,"loc":{"start":{"line":1,"column":29,"index":29},"end":{"line":1,"column":34,"index":34}},
"extra": {
"rawValue": "foo",
"raw": "\"foo\""
Expand All @@ -39,15 +39,15 @@
"assertions": [
{
"type": "ImportAttribute",
"start":33,"end":45,"loc":{"start":{"line":2,"column":2,"index":33},"end":{"line":2,"column":14,"index":45}},
"start":44,"end":56,"loc":{"start":{"line":2,"column":2,"index":44},"end":{"line":2,"column":14,"index":56}},
"key": {
"type": "Identifier",
"start":33,"end":37,"loc":{"start":{"line":2,"column":2,"index":33},"end":{"line":2,"column":6,"index":37},"identifierName":"type"},
"start":44,"end":48,"loc":{"start":{"line":2,"column":2,"index":44},"end":{"line":2,"column":6,"index":48},"identifierName":"type"},
"name": "type"
},
"value": {
"type": "StringLiteral",
"start":39,"end":45,"loc":{"start":{"line":2,"column":8,"index":39},"end":{"line":2,"column":14,"index":45}},
"start":50,"end":56,"loc":{"start":{"line":2,"column":8,"index":50},"end":{"line":2,"column":14,"index":56}},
"extra": {
"rawValue": "json",
"raw": "\"json\""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { x } from "foo" assert { type: "json" }
export { "default" as x } from "foo" assert { type: "json" }
[0]
Original file line number Diff line number Diff line change
@@ -1,34 +1,38 @@
{
"type": "File",
"start":0,"end":51,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":2,"column":3,"index":51}},
"start":0,"end":64,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":2,"column":3,"index":64}},
"program": {
"type": "Program",
"start":0,"end":51,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":2,"column":3,"index":51}},
"start":0,"end":64,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":2,"column":3,"index":64}},
"sourceType": "module",
"interpreter": null,
"body": [
{
"type": "ExportNamedDeclaration",
"start":0,"end":47,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":47,"index":47}},
"start":0,"end":60,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":60,"index":60}},
"specifiers": [
{
"type": "ExportSpecifier",
"start":9,"end":10,"loc":{"start":{"line":1,"column":9,"index":9},"end":{"line":1,"column":10,"index":10}},
"start":9,"end":23,"loc":{"start":{"line":1,"column":9,"index":9},"end":{"line":1,"column":23,"index":23}},
"local": {
"type": "Identifier",
"start":9,"end":10,"loc":{"start":{"line":1,"column":9,"index":9},"end":{"line":1,"column":10,"index":10},"identifierName":"x"},
"name": "x"
"type": "StringLiteral",
"start":9,"end":18,"loc":{"start":{"line":1,"column":9,"index":9},"end":{"line":1,"column":18,"index":18}},
"extra": {
"rawValue": "default",
"raw": "\"default\""
},
"value": "default"
},
"exported": {
"type": "Identifier",
"start":9,"end":10,"loc":{"start":{"line":1,"column":9,"index":9},"end":{"line":1,"column":10,"index":10},"identifierName":"x"},
"start":22,"end":23,"loc":{"start":{"line":1,"column":22,"index":22},"end":{"line":1,"column":23,"index":23},"identifierName":"x"},
"name": "x"
}
}
],
"source": {
"type": "StringLiteral",
"start":18,"end":23,"loc":{"start":{"line":1,"column":18,"index":18},"end":{"line":1,"column":23,"index":23}},
"start":31,"end":36,"loc":{"start":{"line":1,"column":31,"index":31},"end":{"line":1,"column":36,"index":36}},
"extra": {
"rawValue": "foo",
"raw": "\"foo\""
Expand All @@ -39,15 +43,15 @@
"assertions": [
{
"type": "ImportAttribute",
"start":33,"end":45,"loc":{"start":{"line":1,"column":33,"index":33},"end":{"line":1,"column":45,"index":45}},
"start":46,"end":58,"loc":{"start":{"line":1,"column":46,"index":46},"end":{"line":1,"column":58,"index":58}},
"key": {
"type": "Identifier",
"start":33,"end":37,"loc":{"start":{"line":1,"column":33,"index":33},"end":{"line":1,"column":37,"index":37},"identifierName":"type"},
"start":46,"end":50,"loc":{"start":{"line":1,"column":46,"index":46},"end":{"line":1,"column":50,"index":50},"identifierName":"type"},
"name": "type"
},
"value": {
"type": "StringLiteral",
"start":39,"end":45,"loc":{"start":{"line":1,"column":39,"index":39},"end":{"line":1,"column":45,"index":45}},
"start":52,"end":58,"loc":{"start":{"line":1,"column":52,"index":52},"end":{"line":1,"column":58,"index":58}},
"extra": {
"rawValue": "json",
"raw": "\"json\""
Expand All @@ -59,14 +63,14 @@
},
{
"type": "ExpressionStatement",
"start":48,"end":51,"loc":{"start":{"line":2,"column":0,"index":48},"end":{"line":2,"column":3,"index":51}},
"start":61,"end":64,"loc":{"start":{"line":2,"column":0,"index":61},"end":{"line":2,"column":3,"index":64}},
"expression": {
"type": "ArrayExpression",
"start":48,"end":51,"loc":{"start":{"line":2,"column":0,"index":48},"end":{"line":2,"column":3,"index":51}},
"start":61,"end":64,"loc":{"start":{"line":2,"column":0,"index":61},"end":{"line":2,"column":3,"index":64}},
"elements": [
{
"type": "NumericLiteral",
"start":49,"end":50,"loc":{"start":{"line":2,"column":1,"index":49},"end":{"line":2,"column":2,"index":50}},
"start":62,"end":63,"loc":{"start":{"line":2,"column":1,"index":62},"end":{"line":2,"column":2,"index":63}},
"extra": {
"rawValue": 0,
"raw": "0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { foo } from "foo.json" assert { type: "json" };
export { default as foo } from "foo.json" assert { type: "json" };
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
{
"type": "File",
"start":0,"end":55,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":55,"index":55}},
"start":0,"end":66,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":66,"index":66}},
"program": {
"type": "Program",
"start":0,"end":55,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":55,"index":55}},
"start":0,"end":66,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":66,"index":66}},
"sourceType": "module",
"interpreter": null,
"body": [
{
"type": "ExportNamedDeclaration",
"start":0,"end":55,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":55,"index":55}},
"start":0,"end":66,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":66,"index":66}},
"specifiers": [
{
"type": "ExportSpecifier",
"start":9,"end":12,"loc":{"start":{"line":1,"column":9,"index":9},"end":{"line":1,"column":12,"index":12}},
"start":9,"end":23,"loc":{"start":{"line":1,"column":9,"index":9},"end":{"line":1,"column":23,"index":23}},
"local": {
"type": "Identifier",
"start":9,"end":12,"loc":{"start":{"line":1,"column":9,"index":9},"end":{"line":1,"column":12,"index":12},"identifierName":"foo"},
"name": "foo"
"start":9,"end":16,"loc":{"start":{"line":1,"column":9,"index":9},"end":{"line":1,"column":16,"index":16},"identifierName":"default"},
"name": "default"
},
"exported": {
"type": "Identifier",
"start":9,"end":12,"loc":{"start":{"line":1,"column":9,"index":9},"end":{"line":1,"column":12,"index":12},"identifierName":"foo"},
"start":20,"end":23,"loc":{"start":{"line":1,"column":20,"index":20},"end":{"line":1,"column":23,"index":23},"identifierName":"foo"},
"name": "foo"
}
}
],
"source": {
"type": "StringLiteral",
"start":20,"end":30,"loc":{"start":{"line":1,"column":20,"index":20},"end":{"line":1,"column":30,"index":30}},
"start":31,"end":41,"loc":{"start":{"line":1,"column":31,"index":31},"end":{"line":1,"column":41,"index":41}},
"extra": {
"rawValue": "foo.json",
"raw": "\"foo.json\""
Expand All @@ -39,15 +39,15 @@
"assertions": [
{
"type": "ImportAttribute",
"start":40,"end":52,"loc":{"start":{"line":1,"column":40,"index":40},"end":{"line":1,"column":52,"index":52}},
"start":51,"end":63,"loc":{"start":{"line":1,"column":51,"index":51},"end":{"line":1,"column":63,"index":63}},
"key": {
"type": "Identifier",
"start":40,"end":44,"loc":{"start":{"line":1,"column":40,"index":40},"end":{"line":1,"column":44,"index":44},"identifierName":"type"},
"start":51,"end":55,"loc":{"start":{"line":1,"column":51,"index":51},"end":{"line":1,"column":55,"index":55},"identifierName":"type"},
"name": "type"
},
"value": {
"type": "StringLiteral",
"start":46,"end":52,"loc":{"start":{"line":1,"column":46,"index":46},"end":{"line":1,"column":52,"index":52}},
"start":57,"end":63,"loc":{"start":{"line":1,"column":57,"index":57},"end":{"line":1,"column":63,"index":63}},
"extra": {
"rawValue": "json",
"raw": "\"json\""
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { foo } from "foo.json" assert { type: "json", lazy: true, startAtLine: 1 };
export { default } from "foo.json" assert { type: "json", lazy: true, startAtLine: 1 };
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
]
],
"sourceType": "module",
"throws": "Only string literals are allowed as module attribute values. (1:60)"
}
"throws": "Only string literals are allowed as module attribute values. (1:64)"
}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { foo } from "foo.json" assert { lazy: "true" };
export { default } from "foo.json" assert { lazy: "true" };

0 comments on commit a05499e

Please sign in to comment.