1
0
mirror of https://github.com/adobe/brackets.git synced 2024-11-20 09:53:00 +01:00

JsTestDriver scripts. Basic CodeMirror init test.

This commit is contained in:
Jason San Jose 2011-12-08 10:35:29 -08:00
parent a454a7bce0
commit 6bbdfc81a0
6 changed files with 72 additions and 2 deletions

Binary file not shown.

18
test/core/BracketsTest.js Normal file
View File

@ -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
test/core/DemoTest.js Normal file
View File

@ -0,0 +1,6 @@
DemoTest = TestCase("DemoTest");
DemoTest.prototype.testFail = function() {
// sanity check
fail("fail");
};

View File

@ -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
test/server.sh Executable file
View File

@ -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
test/test.sh Executable file
View File

@ -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