project = new Project("key");
JavaScriptSquidSensor sensor = new JavaScriptSquidSensor(mock(RulesProfile.class), fileLinesContextFactory, mock(ResourcePerspectives.class), fs, new NoSonarFilter());
// no JS files -> do not execute
when(fs.files(any(FileQuery.class))).thenReturn(Collections.<File>emptyList());
assertThat(sensor.shouldExecuteOnProject(project)).isFalse();
// at least one JS file -> do execute
when(fs.files(any(FileQuery.class))).thenReturn(Arrays.asList(mock(File.class)));
assertThat(sensor.shouldExecuteOnProject(project)).isTrue();