An example codebase that's used in the book Build Your Own Test Framework (still a work in progress!).
Hello! ๐
If you're joining the workshop on Dec 10, 2019, you can get a headstart by following these instructions. It's four steps, and it should take about 10 minutes in total.
The four steps are:
- Upgrade to (or install) Node version 13.2
- Fork this repo and clone it to your local machine
- Create a new test runner project and link it
- Read the session overview section below
This workshop uses ES6 modules which are on by default from Node 13.2. To check which version, you're on, open a command line and type:
node -v
If Node isn't found, you'll need to install it. If the version is old, please consider upgrading.
Some of you may not wish to upgrade, which is totally fine, however if you're on anything less than 13.2, you'll need to use the --experimental-modules
flag with every Node command.
There's no requirement to fork as this repo isn't the one we'll be doing the most work in.
git clone https://github.com/dirv/todo-example-concise-test.git
During the workshop we'll be modifying the file test/tests.js
.
Most of the workshop will be writing code in a new NPM library. You can get a head start by doing all the plumbing beforehand.
- Open a terminal in your local workspace.
mkdir concise-test
cd concise-test
npm init
-- then fill in all the blanksmkdir src test
- Open package.json and add the following two lines:
"type": "module",
"bin" : "./src/cli"
The todo-example-concise-test
project makes use of this new library you'll be building, so we need to link the two so it can be accessed.
Starting in the project folder of concise-test
that you created in the last step...
npm link
-- this makes it available in your local package repo- Change directory to the previous repo, e.g.
cd ../todo-example-concise-test
npm link concise-test
That's it.
This workshop we'll be building out both the todo-example-concise-test
and concise-test
projects.
The todo-example-concise-test
project is like our scaffold, and will allow us to manually test the constructs we make in concise-test
. As we build more and more features into concise-test
, we'll update concise-test-todo-example
to use those features.
You can see where we're going to end up by looking at the with-concise-test
branch of this repo.