Best Spek code snippet using org.spekframework.intellij.domain.ScopeDescriptorCache.extractSynonymContext
ScopeDescriptorCache.kt
Source:ScopeDescriptorCache.kt
...107 }108 }109 }110 private fun fetchSynonymContext(callExpression: KtCallExpression): SynonymContext? {111 return fetchNamedFunction(callExpression)?.let(::extractSynonymContext)112 }113 private fun fetchNamedFunction(callExpression: KtCallExpression): KtNamedFunction? {114 val mainReference = callExpression.calleeExpression?.mainReference115 val resolved = mainReference?.resolve()116 if (resolved is KtNamedFunction) {117 return resolved118 }119 return null120 }121 private fun extractSynonymContext(function: KtNamedFunction): SynonymContext? {122 val lightMethod = function.toLightMethods().firstOrNull()123 if (lightMethod != null) {124 val synonym = lightMethod.annotations125 .filter { SYNONYM_CLASSES.contains(it.qualifiedName) }126 .map(::PsiSynonym)127 .firstOrNull()128 if (synonym != null) {129 val descriptions = lightMethod.annotations130 .filter { DESCRIPTIONS_CLASSES.contains(it.qualifiedName) }131 .map(::PsiDescriptions)132 .firstOrNull()133 if (descriptions != null) {134 return SynonymContext(synonym, descriptions)135 }...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!