@@ -16,6 +16,17 @@ describe("terraform_handler", function()
16
16
)
17
17
end )
18
18
19
+ it (" aws datasources" , function ()
20
+ assert .equals (
21
+ " https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/route" ,
22
+ handler .handle (" v" , ' data "aws_route" "example" {' )
23
+ )
24
+ assert .equals (
25
+ " https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/region" ,
26
+ handler .handle (" v" , ' data "aws_region" "current" {' )
27
+ )
28
+ end )
29
+
19
30
it (" azure resources" , function ()
20
31
assert .equals (
21
32
" https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group" ,
@@ -27,6 +38,17 @@ describe("terraform_handler", function()
27
38
)
28
39
end )
29
40
41
+ it (" azure datasources" , function ()
42
+ assert .equals (
43
+ " https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/location" ,
44
+ handler .handle (" v" , ' data "azurerm_location" "example" {' )
45
+ )
46
+ assert .equals (
47
+ " https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/resources" ,
48
+ handler .handle (" v" , ' data "azurerm_resources" "spokes" {' )
49
+ )
50
+ end )
51
+
30
52
it (" google resources" , function ()
31
53
assert .equals (
32
54
" https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_instance" ,
@@ -38,6 +60,13 @@ describe("terraform_handler", function()
38
60
)
39
61
end )
40
62
63
+ it (" google datasources" , function ()
64
+ assert .equals (
65
+ " https://registry.terraform.io/providers/hashicorp/google/latest/docs/data-sources/compute_images" ,
66
+ handler .handle (" v" , ' data "google_compute_images" "example" {' )
67
+ )
68
+ end )
69
+
41
70
it (" kubernetes resources" , function ()
42
71
assert .equals (
43
72
" https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/deployment" ,
@@ -49,10 +78,16 @@ describe("terraform_handler", function()
49
78
)
50
79
end )
51
80
81
+ it (" kubernetes datasources" , function ()
82
+ assert .equals (
83
+ " https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/data-sources/mutating_webhook_configuration_v1" ,
84
+ handler .handle (" v" , ' data "kubernetes_mutating_webhook_configuration_v1" "example" {' )
85
+ )
86
+ end )
87
+
52
88
it (" non-terraform lines" , function ()
53
89
assert .is_nil (handler .handle (" v" , " This is not a terraform resource" ))
54
90
assert .is_nil (handler .handle (" v" , ' variable "example" {' ))
55
- assert .is_nil (handler .handle (" v" , ' data "aws_ami" "example" {' ))
56
91
assert .is_nil (handler .handle (" v" , ' resource "unknown_provider_resource" "example" {' ))
57
92
end )
58
93
end )
0 commit comments