use of com.google.jstestdriver.idea.common.JsErrorMessage in project intellij-plugins by JetBrains.
the class JsErrorMessageTest method testUncaughtError.
public void testUncaughtError() throws Exception {
String text = "error loading file: /test/assertFramework/jstd/structure/emptyTestCase.js:301: Uncaught Error: xhrFailed";
JsErrorMessage errorMessage = JsErrorMessage.parseFromText(text, myBasePath);
assertNotNull(errorMessage);
assertEquals(new File(myBasePath, "assertFramework/jstd/structure/emptyTestCase.js"), errorMessage.getFileWithError());
assertEquals(301, errorMessage.getLineNumber());
assertEquals(null, errorMessage.getColumnNumber());
assertEquals("Uncaught Error", errorMessage.getErrorName());
}
use of com.google.jstestdriver.idea.common.JsErrorMessage in project intellij-plugins by JetBrains.
the class JsErrorMessageTest method testReferenceErrorParsing.
public void testReferenceErrorParsing() throws Exception {
String text = "error loading file: /test/assertFramework/jstd/structure/emptyTestCase.js:2: Uncaught ReferenceError: gg is not defined";
JsErrorMessage errorMessage = JsErrorMessage.parseFromText(text, myBasePath);
assertNotNull(errorMessage);
assertEquals(new File(myBasePath, "assertFramework/jstd/structure/emptyTestCase.js"), errorMessage.getFileWithError());
assertEquals(2, errorMessage.getLineNumber());
assertEquals(null, errorMessage.getColumnNumber());
assertEquals("Uncaught ReferenceError", errorMessage.getErrorName());
}
use of com.google.jstestdriver.idea.common.JsErrorMessage in project intellij-plugins by JetBrains.
the class BrowserErrorNode method newBrowserErrorNode.
@NotNull
public static BrowserErrorNode newBrowserErrorNode(@NotNull BrowserNode parent, @Nullable String pathToJsFileWithError, @Nullable String errorMessage) {
ConfigNode configNode = parent.getParent();
String basePath = configNode.getAbsoluteBasePath();
final JsErrorMessage parsedErrorMessage;
if (basePath != null && errorMessage != null) {
parsedErrorMessage = JsErrorMessage.parseFromText(errorMessage, new File(basePath));
} else {
parsedErrorMessage = null;
}
JsErrorMessage result = null;
if (pathToJsFileWithError == null) {
result = parsedErrorMessage;
} else {
File file = new File(pathToJsFileWithError);
if (file.isAbsolute() && file.isFile()) {
if (parsedErrorMessage != null && parsedErrorMessage.getFileWithError().equals(file)) {
result = parsedErrorMessage;
} else {
result = new JsErrorMessage(file, 1, null, false, null, -1, -1);
}
}
}
return new BrowserErrorNode(parent, result);
}
use of com.google.jstestdriver.idea.common.JsErrorMessage in project intellij-plugins by JetBrains.
the class JsErrorMessageTest method testOperaError.
public void testOperaError() throws Exception {
String text = "error loading file: /test/assertFramework/jstd/structure/emptyTestCase.js:1: Uncaught exception: ReferenceError: Undefined variable: gg";
JsErrorMessage errorMessage = JsErrorMessage.parseFromText(text, myBasePath);
assertNotNull(errorMessage);
assertEquals(new File(myBasePath, "assertFramework/jstd/structure/emptyTestCase.js"), errorMessage.getFileWithError());
assertEquals(1, errorMessage.getLineNumber());
assertEquals(null, errorMessage.getColumnNumber());
assertEquals("Uncaught ReferenceError", errorMessage.getErrorName());
}
use of com.google.jstestdriver.idea.common.JsErrorMessage in project intellij-plugins by JetBrains.
the class JsErrorMessageTest method testColumnNumber.
public void testColumnNumber() throws Exception {
String text = "error loading file: /test/assertFramework/jstd/structure/emptyTestCase.js:1:10: Uncaught ReferenceError";
JsErrorMessage errorMessage = JsErrorMessage.parseFromText(text, myBasePath);
assertNotNull(errorMessage);
assertEquals(new File(myBasePath, "assertFramework/jstd/structure/emptyTestCase.js"), errorMessage.getFileWithError());
assertEquals(1, errorMessage.getLineNumber());
assertEquals(new Integer(10), errorMessage.getColumnNumber());
assertEquals("Uncaught ReferenceError", errorMessage.getErrorName());
}
Aggregations