use of com.google.idea.blaze.base.run.producers.PendingWebTestContext in project intellij by bazelbuild.
the class JavascriptTestContextProviderTest method testMultipleBrowsers.
@Test
public void testMultipleBrowsers() throws Throwable {
PsiFile jsTestFile = configure(ImmutableList.of("chrome-linux", "firefox-linux"), "function testFoo() {}");
ConfigurationContext context = createContextFromPsi(jsTestFile);
ConfigurationFromContext configurationFromContext = getConfigurationFromContext(context);
BlazeCommandRunConfiguration configuration = getBlazeRunConfiguration(configurationFromContext);
assertThat(configuration.getPendingContext()).isNotNull();
assertThat(configuration.getPendingContext()).isInstanceOf(PendingWebTestContext.class);
PendingWebTestContext testContext = (PendingWebTestContext) configuration.getPendingContext();
testContext.updateContextAndRerun(configuration, TargetInfo.builder(Label.create("//foo/bar:foo_test_firefox-linux"), "js_web_test").build(), () -> {
});
assertThat(configuration.getTargetKind()).isEqualTo(Kind.fromRuleName("js_web_test"));
assertThat(configuration.getTargets()).containsExactly(TargetExpression.fromStringSafe("//foo/bar:foo_test_firefox-linux"));
}
use of com.google.idea.blaze.base.run.producers.PendingWebTestContext in project intellij by bazelbuild.
the class OldJavascriptTestContextProviderTest method testMultipleBrowsers.
@Test
public void testMultipleBrowsers() throws Throwable {
PsiFile jsTestFile = configure(ImmutableList.of("chrome-linux", "firefox-linux"), "function testFoo() {}");
ConfigurationContext context = createContextFromPsi(jsTestFile);
ConfigurationFromContext configurationFromContext = getConfigurationFromContext(context);
BlazeCommandRunConfiguration configuration = getBlazeRunConfiguration(configurationFromContext);
assertThat(configuration.getPendingContext()).isNotNull();
assertThat(configuration.getPendingContext()).isInstanceOf(PendingWebTestContext.class);
PendingWebTestContext testContext = (PendingWebTestContext) configuration.getPendingContext();
testContext.updateContextAndRerun(configuration, TargetInfo.builder(Label.create("//foo/bar:foo_test_firefox-linux"), "web_test").build(), () -> {
});
assertThat(configuration.getTargetKind()).isEqualTo(RuleTypes.WEB_TEST.getKind());
assertThat(configuration.getTargets()).containsExactly(TargetExpression.fromStringSafe("//foo/bar:foo_test_firefox-linux"));
}
Aggregations