Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Commit

Permalink
JsTestDriver scripts. Basic CodeMirror init test.
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonsanjose committed Dec 8, 2011
1 parent a454a7b commit 6bbdfc8
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 2 deletions.
Binary file modified test/JsTestDriver.jar
Binary file not shown.
18 changes: 18 additions & 0 deletions test/core/BracketsTest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
BracketsTest = TestCase("BracketsTest");

BracketsTest.prototype.testCodeMirrorInit = function() {
// add #editor to document
/*:DOC += <div id="editor"/> */

// init CodeMirror instance
var content = 'Brackets is going to be awesome!"\n';
var myCodeMirror = CodeMirror($('#editor').get(0), {
value: content
});

// verify editor content
assertEquals(content, myCodeMirror.getValue());

// print to console
jstestdriver.console.log("CodeMirror.getValue() = ", myCodeMirror.getValue());
};
6 changes: 6 additions & 0 deletions test/core/DemoTest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
DemoTest = TestCase("DemoTest");

This comment has been minimized.

Copy link
@gruehle

gruehle Dec 8, 2011

Member

What is this demo test used for?


DemoTest.prototype.testFail = function() {
// sanity check
fail("fail");
};
9 changes: 7 additions & 2 deletions test/jsTestDriver.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
server: http://localhost:9876

load:
- src/*.js
- src-test/*.js
- ../src/thirdparty/CodeMirror2/lib/*.js
- ../src/thirdparty/CodeMirror2/lib/util/*.js
- ../src/thirdparty/CodeMirror2/mode/javascript/javascript.js
- ../src/thirdparty/*.js

test:
- core/*.js
19 changes: 19 additions & 0 deletions test/server.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash
while getopts "j:p:" flag
do
if [ $flag == "j" ]; then
JSTD=$OPTARG
elif [ $flag == "p" ]; then
PORT=$OPTARG
fi
done

if [ -z "$PORT" ]; then
PORT=9876
fi

if [ -z "$JSTD" ]; then
JSTD=`ls JsTestDriver.jar`
fi

java -jar $JSTD --port $PORT --config jsTestDriver.conf
22 changes: 22 additions & 0 deletions test/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
while getopts "j:t:" flag
do
if [ $flag == "j" ]; then
JSTD=$OPTARG
elif [ $flag == "t" ]; then
TESTS=$OPTARG
fi
done

if [ -z "$JSTD" ]; then
JSTD=`ls JsTestDriver.jar`
fi

if [ -z "$TESTS" ]; then
TESTS="all"
echo "Running all tests"
else
echo "Running '$TESTS'"
fi

java -jar $JSTD --tests "$TESTS" --config jsTestDriver.conf --reset

1 comment on commit 6bbdfc8

@gruehle
Copy link
Member

@gruehle gruehle commented on 6bbdfc8 Dec 8, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

Please sign in to comment.