tomblachut / svelte-intellij

Svelte components in WebStorm and friends
MIT License
482 stars 38 forks source link

Expand SvelteResolveTest #138

Closed tomblachut closed 3 years ago

tomblachut commented 4 years ago

I've created SvelteResolveTest in #137 but there's definitely room for adding more cases.

TODO


FYI Vue plugin is using following helper in some tests:

    private fun doTestResolveLocallyInsideComponent(text: String, expectedPropertyName: String?) {
        myFixture.configureByText("ResolveLocallyInsideComponent.vue", text)
        val reference = myFixture.getReferenceAtCaretPosition()
        TestCase.assertNotNull(reference)
        val target = reference!!.resolve()
        if (expectedPropertyName == null) {
            TestCase.assertNull(target)
        } else {
            val property = if (target is JSImplicitElement) target.parent else target
            TestCase.assertTrue(property is JSProperty)
            TestCase.assertEquals(expectedPropertyName, (property as JSProperty).name)
        }
    }