Storyteller is a tool for crafting executable specifications.
After doing a new git clone of the code, run npm run build
at the command line from the root directory.
The Storyteller code consists of two parts, a web based client written in Javascript and the actual specification engine and a self-contained web host written in C#. In order to work with the Storyteller code, you'll need to have both an installation of Node.js v12 with npm and .Net 4.5 on your box. To start working with the code, first run the build with the command npm run build
or if you're on Windows, use the build.cmd
script. Running this command will:
- Install all the necessary npm packages for the client side
- Build the bundled javascript products that need to be embedded into the .Net code
- Runs all the Javascript tests
- Installs the necessary Nuget dependencies for the .Net code
- Builds and tests the .Net code
The client code is built with React.js as the view technology and Webpack as the client build tool. The client side automation is done through npm at the command line:
npm run build-client
- precompile the JSX files, do ES6 to ES5 transformations, and bundle the filesnpm run watch
- same as above, but watches for changes and builds automaticallynpm run test
- runs all the Javascript testsnpm run harness
- hosts the client code with a stubbed in backend athttp://localhost:3000
using the React hot loader for rapid UI worknpm run test-mocha
- run the unit tests against the /lib foldernpm run tdd-mocha
- run the unit tests against the /lib folder in watched modenpm run test-karma
- run the karma tests against the JSX componentsnpm run tdd-karma
- run the karma tests against the JSX components in watched modenpm run smoke-test
- runs a series of karma tests against all the sample specifications
and as stated earlier, npm run build
builds and tests both the client side Javascript and server side .Net at one time.
The client side code is in the /client folder. The javascript code is organized as follows:
- /components - All the React.js components as JSX files
- /component-tests - Karma tests against the React.js components
- /lib - All the other Javascript code. Data stores, controllers, presenters, domain model objects. Storyteller is roughly using a Flux style architecture using Postal.js as an event aggregator
- /lib-tests - Mocha tests against the lib code
The source code is in the /src folder. For the moment, we're using Visual Studio.Net and the solution file is at src/Storyteller.sln. As DNX matures we will probably move to eliminate the .sln and .csproj files in the code repository. You will need to run the command line build at least once before opening the C# code in Visual Studio.
From the command line, we're just using an npm script npm run build-server
to build and test the .Net code. The relevant commands are:
npm run build-server
- restore nuget packages, build, and testpaket install
- restores nuget packagesnode build/buildServer
- compiles and runs the .Net tests if you want to bypass the paket install
The .Net code uses Paket for Nuget dependency management and Fixie for unit testing. At this time we're emulating NUnit behavior, but this is expected to change to Fixie idioms at a later time.