Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions SpecRunner.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<html>
<head>
<title>Jasmine Test Runner</title>
<link rel="stylesheet" type="text/css" href="lib/jasmine-1.0.2/jasmine.css">
<script type="text/javascript" src="lib/jasmine-1.0.2/jasmine.js"></script>
<script type="text/javascript" src="lib/jasmine-1.0.2/jasmine-html.js"></script>
<link rel="stylesheet" type="text/css" href="lib/jasmine-1.1.0/jasmine.css">
<script type="text/javascript" src="lib/jasmine-1.1.0/jasmine.js"></script>
<script type="text/javascript" src="lib/jasmine-1.1.0/jasmine-html.js"></script>

<!-- include source files here... -->
<script type="text/javascript" src="src/App.js"></script>
Expand Down
96 changes: 96 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<?xml version="1.0" encoding="ISO-8859-1"?>

<!--
The <project> tag defines the ant project and
the default build task to run initiated. It
also defines the base directory which is set
to the current folder this file lives in.
-->
<project name="dateJS" default="build" basedir=".">
<!--
The <property> tag defines variables we
are using to store the path to different
files and tools required and input/output
directories. You use those variables by
like this: ${variable}
-->
<property name="BUILD_DIR" value="build" />
<property name="SOURCE_DIR" value="src" />
<property name="LIB_DIR" value="lib" />
<property name="EXTERNAL_DIR" value="${LIB_DIR}/external" />
<property name="LOCAL_DIR" value="${LIB_DIR}/local" />
<property name="RESOURCE_DIR" value="${LIB_DIR}/bin" />
<property name="YUI_COMPRESSOR" value="${RESOURCE_DIR}/yui-compressor/yuicompressor-2.4.7.jar" />
<!--
The <target> tags defines an ant task.
You have to give it a unique name and
list other task (if any) this task
depends on. Ant will run those task first.

This task below is the default task defined
in the <project> tag. It will run all the
dependents.
-->
<target name="build" depends="clean, bundle_javascript, compress_javascript" />
<!--
This is the "create JavaScript bundles" task
used to create concatenated files for each
category defined and a main application bundle
which contains all the code we need in one file.
-->
<target name="bundle_javascript">
<!-- create the output directory for built files -->
<mkdir dir="${BUILD_DIR}/js"/>
<echo>Bundle JavaScript Files...</echo>
<!-- external.js: all shared third party code -->
<concat destfile="${BUILD_DIR}/js/external.js">
<fileset dir="${EXTERNAL_DIR}/js" casesensitive="yes">
<include name="**/*.js"/>
</fileset>
</concat>
<!-- local.js: all shared local code -->
<concat destfile="${BUILD_DIR}/js/local.js">
<fileset dir="${LOCAL_DIR}/js" casesensitive="yes">
<include name="**/*.js"/>
</fileset>
</concat>
<!-- core.js: all the core project related code -->
<concat destfile="${BUILD_DIR}/js/core.js">
<fileset dir="${SOURCE_DIR}" casesensitive="yes">
<include name="**/*.js"/>
</fileset>
</concat>
<!-- main.js: the main big bundle of all the previous bundles -->
<concat destfile="${BUILD_DIR}/js/main.js">
<filelist dir="${BUILD_DIR}/js/" files="external.js, local.js, core.js"/>
</concat>
<echo>JavaScript Bundles Done!!!</echo>
</target>
<!--
This task will compress the main.js bundle using YUI
compressor and rename the file main.compress.js
-->
<target name="compress_javascript" depends="bundle_javascript">
<echo>Compressing JavaScript Files...</echo>
<apply executable="java" parallel="false">
<fileset dir="${BUILD_DIR}/js" includes="main.js"/>
<arg line="-jar"/>
<arg path="${YUI_COMPRESSOR}"/>
<srcfile/>
<arg line="-o"/>
<mapper type="glob" from="*.js" to="${BUILD_DIR}/js/*.compress.js"/>
<targetfile/>
</apply>
<echo>JavaScript Compression Done!!!</echo>
</target>
<!--
This task will clean out any previous build files by
deleting the current build folder and re-creating it
-->
<target name="clean">
<echo>Delete old build folder...</echo>
<delete dir="build"/>
<echo>Create new build folder...</echo>
<mkdir dir="${BUILD_DIR}"/>
</target>
</project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2008-2010 Pivotal Labs
Copyright (c) 2008-2011 Pivotal Labs

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jasmine.TrivialReporter.prototype.reportRunnerStarting = function(runner) {
this.outerDiv = this.createDom('div', { className: 'jasmine_reporter' },
this.createDom('div', { className: 'banner' },
this.createDom('div', { className: 'logo' },
this.createDom('a', { href: 'http://pivotal.github.com/jasmine/', target: "_blank" }, "Jasmine"),
this.createDom('span', { className: 'title' }, "Jasmine"),
this.createDom('span', { className: 'version' }, runner.env.versionString())),
this.createDom('div', { className: 'options' },
"Show ",
Expand Down Expand Up @@ -110,7 +110,7 @@ jasmine.TrivialReporter.prototype.reportRunnerResults = function(runner) {
jasmine.TrivialReporter.prototype.reportSuiteResults = function(suite) {
var results = suite.results();
var status = results.passed() ? 'passed' : 'failed';
if (results.totalCount == 0) { // todo: change this to check results.skipped
if (results.totalCount === 0) { // todo: change this to check results.skipped
status = 'skipped';
}
this.suiteDivs[suite.id].className += " " + status;
Expand Down Expand Up @@ -183,6 +183,8 @@ jasmine.TrivialReporter.prototype.specFilter = function(spec) {
paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]);
}

if (!paramMap["spec"]) return true;
return spec.getFullName().indexOf(paramMap["spec"]) == 0;
if (!paramMap.spec) {
return true;
}
return spec.getFullName().indexOf(paramMap.spec) === 0;
};
File renamed without changes.
Loading