This is the base project for CPSC310. You will extend this codebase for all of the deliverables in the project. Please keep your repository private.
The course webpage is your best resource for additional details about the project, AutoTest, and the specific requirements of each project deliverable. These resources will be frequently updated as the term progresses.
To start using this project you need to get your computer configured so you can build and execute the code. This process should be largely similar to the cpsc310starter
repo used during the first lab. To do this, follow these steps; the specifics of each step (especially the first two) will vary based on which operating system your computer has:
-
Install git (v2.6+) (you should be able to execute
git --version
on the command line). -
Install Node (v6+), which will also install YARN (you should be able to execute
node --version
andyarn --version
the command line). -
Clone the project:
git clone git@github.com:CS310-2017Jan/cpsc310project_teamXXX.git
(whereXXX
is your team number). You can also clone the repo by visiting your project in Github and getting the clone target by clicking on the green button on your project repository.
Once your project is configured you need to further prepare the project's tooling and dependencies. In the cpsc310project
folder (on OS X / Linux):
-
yarn run clean
-
yarn run configure
-
yarn run build
If you use Windows; instead try (and hope):
-
yarn run cleanwin
-
yarn run configurewin
-
yarn run build
The sample project ships with some automated unit tests. These commands will execute the suites:
- Test:
yarn run test
(oryarn test
) - Test coverage:
yarn run cover
(oryarn run coverwin
if you use Windows). HTML reports can be found:./coverage/lcov-report/index.html
You can also run the tests as a Mocha target inside your favourite IDE (WebStorm and VSCode both work well and are free for academic use); some students are also using Atom and Cloud9 (although this will require a bit of fiddling since it runs in the cloud).
To invoke the private suite, add a @CPSC310Bot
mention to any commit in your main branch in Github. Remember: these are rate limited so choose your commits wisely. Additional details can be found in the AutoTest documentation.
yarn run start
As you change your TypeScript code you will have to re-compile. This can be done with yarn run build
to build the system and get it ready to execute. You should always fix any compilation errors shown in this step; this is required for AutoTest to succeed. New unit tests can be written and added to /test
; as long as the tests end in Spec.ts
they will be executed automatically when you run yarn run test
.
While these instructions are for WebStorm, other IDEs (e.g., VSCode, Atom, etc.) and editors (e.g., Sublime) should be similar, or will at least be compatible with the command line options described above.
To run or test the system in WebStorm you will need to configure run targets:
-
To run the system: Go to the
Run->Edit Configurations
and tap on the+
and thenNode.js
. Point the 'JavaScript file' argument tosrc/App.js
. -
To run unit tests: Go to the
Run->Edit Configurations
and tap on the+
and thenMocha
. Point the 'Test Directory' file argument totest/
. You can also optionally tap the+
in theBefore launch
box and selectCompile TypeScript
if you want to make sure a fresh TypeScript compile is forced before each test run.