public void CanValidateScriptWithSingleQuote() { // Arrange var validator = new JsHintValidator(); // Act var result = validator.Validate("$('.test');", new Options()); // Assert Assert.That(result, Is.Not.Null); }
public void CanValidateValidScript() { // Arrange var script = "var answer = 42;"; var validator = new JsHintValidator(); // Act var result = validator.Validate(script, new Options()); // Assert Assert.That(result.Errors.Count, Is.EqualTo(0)); }
public void CanValidateScriptWithOctalEscapeSequence() { // Arrange var script = "var x = \"\\012\";"; var validator = new JsHintValidator(); // Act var result = validator.Validate(script, new Options()); // Assert Assert.That(result, Is.Not.Null); }
public void CanFindErrorInScript() { // Arrange var script = "var answer = 42 == 42;"; var validator = new JsHintValidator(); // Act var result = validator.Validate(script, new Options {Eqeqeq = true}); // Assert Assert.That(result.Errors.Count, Is.EqualTo(1)); }
public void CanValidateScriptWithNewLine() { // Arrange var validator = new JsHintValidator(); // Act var result = validator.Validate(@" $(document).ready(function () { }); ", new Options()); // Assert Assert.That(result, Is.Not.Null); }