Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

integrated test runner #181

Merged
merged 154 commits into from
Sep 13, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
154 commits
Select commit Hold shift + click to select a range
94643ad
kick off automated testing
basarat Aug 22, 2016
1588be1
called tested now
basarat Aug 22, 2016
9614bde
wip
basarat Aug 22, 2016
ecb5d62
master: use the rocket icon
basarat Aug 22, 2016
bda53a9
wip
basarat Aug 22, 2016
8e1217a
fix build
Aug 22, 2016
6312672
build fix
Aug 23, 2016
f6a4345
wip test cache
Aug 23, 2016
4885d44
lazy
Aug 23, 2016
3fdaffc
wip tested
Aug 23, 2016
23abebe
yay
Aug 23, 2016
4058b14
master : semantic arg name for find up
Aug 24, 2016
2febba4
tested.json parsing
Aug 24, 2016
9aa2a1a
wip tested
Aug 24, 2016
01ea421
fix
Aug 25, 2016
a20c7d8
initial boot as well
Aug 25, 2016
1e7618c
expansion is working fine
Aug 25, 2016
9e004b7
file paths expansion fix
Aug 25, 2016
1e6af26
allows
Aug 25, 2016
274e6c1
starting a mocha runner
Aug 25, 2016
ec67113
mocha runner
Aug 25, 2016
e18f8bb
lots
Aug 25, 2016
8e0e8b3
reset the cache
Aug 25, 2016
16b2bf6
better config file name
Aug 25, 2016
110b093
working support
Aug 25, 2016
2ee31be
alm.json as I plan to add more stuff and don't want 20 config files
Aug 25, 2016
ff55e04
alm.json
Aug 25, 2016
315b2a3
will sort it out later
Aug 25, 2016
898f6c2
HOT fix :)
Aug 26, 2016
72ed52d
set tested worker project dir
Aug 26, 2016
853d0f1
we are closer than we were yesterday :rose:
Aug 26, 2016
c7bee5f
put a tap on it
Aug 26, 2016
419b6d5
cleanups
Aug 26, 2016
1feae9b
test
Aug 26, 2016
8ad5770
tested
Aug 26, 2016
4d215a3
maste :memo: the order was whack
basarat Aug 27, 2016
03685a9
master : new installs
basarat Aug 27, 2016
7de588b
various
basarat Aug 27, 2016
e80c160
fix mocha paths for windows
basarat Aug 27, 2016
06a8e70
gather test stats
basarat Aug 27, 2016
cbe6026
plan
basarat Aug 27, 2016
b80ec64
much more code
basarat Aug 28, 2016
acc4eb1
suite nesting + stats at each level
basarat Aug 28, 2016
4863908
failure
basarat Aug 28, 2016
6cca03d
\o/
basarat Aug 28, 2016
318a488
disable cache to prevent random errors
Aug 29, 2016
951e2f6
remove done todos
Aug 29, 2016
9edde3f
set results
Aug 29, 2016
67e1dea
chore : name cleanups
Aug 29, 2016
d71562b
got the test results all the way to the frontend
basarat Aug 29, 2016
d708a97
get test results to the status bar
basarat Aug 29, 2016
80bbcfb
active project rendered
basarat Aug 29, 2016
4b21959
master : should have always been like that
basarat Aug 29, 2016
89ac55d
status bar stuff for tests as well
basarat Aug 29, 2016
898801b
better status
basarat Aug 29, 2016
0987208
the rocket belongs next to the error count
basarat Aug 29, 2016
9ad15dd
make a copy so it can be mutated
basarat Aug 29, 2016
cdf81fd
cleanup
basarat Aug 29, 2016
542c999
inform when the tests are running
basarat Aug 29, 2016
d3bfc8d
more robust error count
Aug 29, 2016
7a91ab8
cleanup
Aug 29, 2016
fa373a8
better
Aug 29, 2016
32e3376
:memo:
Aug 29, 2016
1b577d6
quick starts
Aug 29, 2016
6c1e608
doneies
Aug 30, 2016
bbc4436
fix a few errors
Aug 31, 2016
d75dfae
run that js
Aug 31, 2016
0777a79
console instrumentation works now
Aug 31, 2016
7d21ef5
testedMonaco
Aug 31, 2016
a499cd3
about to log
Aug 31, 2016
b79ad8d
show the markers
Aug 31, 2016
01764f1
tada
Aug 31, 2016
0fd657c
better inline log
Aug 31, 2016
c56f2f8
ideas
Aug 31, 2016
47db706
overlay is good enough for now. Not very happy with it but its what m…
Sep 1, 2016
944391c
so good
Sep 1, 2016
3450da6
better styling
Sep 1, 2016
a07a8c6
delta list
Sep 1, 2016
e9c6858
cleanups
Sep 1, 2016
e1db282
cleanups
Sep 1, 2016
534f32e
cleanups delta tested moncao
Sep 1, 2016
117fe07
more styling
Sep 1, 2016
b638130
moar styling
Sep 2, 2016
59911d9
don't need this power
Sep 2, 2016
5b5c803
cleanups
Sep 3, 2016
2cf132a
more progress
Sep 3, 2016
b758abe
make path consistent
basarat Sep 4, 2016
fa965fd
fix stack parsing for windows
basarat Sep 4, 2016
8f7ec16
use alm to develop alm
basarat Sep 5, 2016
5844b39
monaco :)
basarat Sep 5, 2016
5eac285
future ready for log positions that might not be in the current file
basarat Sep 5, 2016
fa8063f
future
basarat Sep 5, 2016
0634624
mock out more functions
basarat Sep 5, 2016
5919210
:memo:
basarat Sep 5, 2016
62fa0f5
use _mocha
basarat Sep 5, 2016
77dbc46
cleanup
basarat Sep 5, 2016
b65fc7d
cleanups
basarat Sep 5, 2016
0564c8f
cleaner
basarat Sep 5, 2016
07c5ff0
fix random parsing error
basarat Sep 5, 2016
a848997
require all non tests
basarat Sep 5, 2016
de62277
already done
basarat Sep 5, 2016
ee5efd3
known working
basarat Sep 5, 2016
aea064d
fingers crossed
basarat Sep 5, 2016
c7eae68
face palm
Sep 7, 2016
11a61be
suite up
Sep 7, 2016
efa507b
note them positions
Sep 7, 2016
dcc157f
note down describe / it positions and send them to the frontend
Sep 7, 2016
6311e5b
cleanups
Sep 7, 2016
507054f
moar styles
Sep 8, 2016
2226c57
better
Sep 8, 2016
50b8686
cause of source map problems
Sep 8, 2016
e7a2007
util
Sep 8, 2016
1aea139
consistent bug icon
Sep 8, 2016
1b06ae5
Here ... *you handle it* :-/ :)
Sep 8, 2016
2db9278
glad to be rid of that hack :rose:
Sep 8, 2016
ca92efe
handle stack less errors
Sep 8, 2016
77aebfa
hot fix
Sep 11, 2016
c1d3242
better
Sep 11, 2016
0a5d750
better more local handling
Sep 11, 2016
85f454e
more styles
Sep 11, 2016
df30b5e
a highlight color under a test that is failing was confusing
Sep 11, 2016
501ef91
stack after mocha
Sep 11, 2016
7b7aa8a
more reliable stack after mocha
Sep 11, 2016
5a5b94b
better inline error usability
Sep 11, 2016
64b2775
travel up dir tree is also consistent
basarat Sep 11, 2016
027d37c
the bug icon made it look like a *bug* in success cases as well
basarat Sep 11, 2016
09b20ef
padding
basarat Sep 11, 2016
25d53fb
better duration formatting
basarat Sep 11, 2016
c591fda
node v6 from now on
basarat Sep 12, 2016
f9cc305
initial test results view
basarat Sep 12, 2016
eadf6fa
cleanups
basarat Sep 12, 2016
3723392
send after updating the `last` in local cache
basarat Sep 12, 2016
164b0b1
more test view love
basarat Sep 12, 2016
a553671
working on the selected test view
basarat Sep 12, 2016
a81112f
click to open
basarat Sep 12, 2016
73f359b
status bar click
basarat Sep 12, 2016
71c01bd
moar view work
basarat Sep 12, 2016
4a7a989
show working
basarat Sep 12, 2016
15b8557
rocket didn't make sense
basarat Sep 12, 2016
bb31e0a
moar ui
basarat Sep 12, 2016
ef0d5be
made csx an explicit dependency
Sep 12, 2016
a183d7c
consolidate
basarat Sep 12, 2016
25241b2
try on a mac
basarat Sep 12, 2016
fc6d080
time is self documenting
Sep 12, 2016
435f4e9
better
basarat Sep 12, 2016
4e8b88d
show stack trace
basarat Sep 12, 2016
4ca2491
stack
basarat Sep 12, 2016
5dccabb
borders to guide us
basarat Sep 12, 2016
9fa1142
update to TypeScript latest
basarat Sep 12, 2016
582d864
ts path completions
basarat Sep 12, 2016
65cdbb1
address no longer relevant todo
Sep 12, 2016
8d1f041
a few concepts going around here. But its good enough for now :knife:
Sep 12, 2016
74f202c
styling
Sep 13, 2016
91ce4f6
:memo:
Sep 13, 2016
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
## Requirements

* Chrome
* NodeJS v5
* NodeJS v6

## Usage

Expand Down
7 changes: 7 additions & 0 deletions alm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"tests": {
"include": [
"./src/tests/**/*"
]
}
}
1 change: 1 addition & 0 deletions docs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
* [HTML to TSX](/features/html-to-tsx.md)
* [JSON to TypeScript](/features/json-to-dts.md)
* [JavaScript Support](/features/javascript.md)
* [Testing](/features/testing.md)
* [Documentation Writing](/features/docblockr.md)
* [Configuration](/config/README.md)
* [Editor Config](/config/editorconfig.md)
Expand Down
15 changes: 8 additions & 7 deletions docs/contributing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,30 @@ You need:
```
git clone https://github.com/alm-tools/alm.git
cd alm
npm install
```

We highly recommend you use [`nodemon`](https://github.com/remy/nodemon), just run it from the project root:
Now just run. It will start `alm` using nodemon:

```
npm install nodemon -g
nodemon
npm start
```

Alternatively if you want to test `alm` on another folder e.g. `your project` (i.e not our folder with our test files) you can make the dev version of `alm` avialable globally with:
Also you can use this *build* version of `alm` on another folder e.g. `your project` (i.e not our folder with our test files) simply by running:

```
npm install
npm link
```

# Workflow

Once you have `nodemon` running, if you edit any front-end ts file our Webpack setup will reload the front end only. Make a change to some backend file and the app restarts :rose:
Once you have `npm start` running, if you edit any front-end ts file our Webpack setup will reload the front end only. Make a change to some backend file and our running nodemon will make the whole app restart 🌹

# IDE

You are free to use any IDE but you should also run `npm run tscw` to run the same TypeScript version as alm in watch mode.
We use alm to develop alm. Run `npm run alm` to launch a last published version of alm to develop alm.

You are free to use some other IDE if you want. You can run `npm run tscw` to run the TypeScript in the background in watch mode and use your favorite IDE in the foreground.

# Webpack
All our front-end js gets minified into `bundle.js`. This is what gets npm deployed.
Expand Down
6 changes: 6 additions & 0 deletions docs/contributing/dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,9 @@ Here we mention some of the dependencies and what we use them for:
* react: main ui framework
* free-style: provides css style sheet features using just JavaScript. [See this blog post about it](https://medium.com/@basarat/css-modules-are-not-the-solution-1235696863d6#.ar4ydjv4m).
* marked: markdown parser (markdown -> html)


## Tested

* `mocha`
* `ts-node`
6 changes: 3 additions & 3 deletions docs/features/omni-search.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

A unified search input for the following:

* [File Search](#file-search)
* [Command Search](#command-search)
* [Project Search](#project-search)
* [Symbol Search](#symbol-search)
* [Project FilePath Search](#project-filepath-search)
* [Symbol Search](#symbol-search)
* [File Search](#file-search)
* [Project Search](#project-search)

## Command Search

Expand Down
56 changes: 56 additions & 0 deletions docs/features/testing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Testing

Having your test results integrated into the IDE is a feature that can greatly enhance any test driven development experience. We support `mocha` based testing out of the box ([mocha reigns as the king of testing frameworks][stats]).

## Configuration

Add a simple `alm.json` at the root working directory of your project e.g.:

```json
{
"tests": {
"include": [
"./src/tests/**/*_spec.ts",
"./src/tests/**/*_spec.tsx"
]
}
}
```
Optionally you can also provide an `exclude` pattern.

> `include` and `exclude` have the same behaviour as TypeScript's tsconfig. In fact we use the ts compiler to expand these.

Testing is automatically enabled if such a file is detected and disabled otherwise.

## Status bar

If a testing configuration is detected in `alm.json` we run the tests and show you the test count / fails / passes in the status bar.

![](https://raw.githubusercontent.com/alm-tools/alm-tools.github.io/master/screens/tested/statusBarIcon.png)

## Inline
`console.log` and errors are shown inline in the editor.

> TIP: you can use a test file to quickly test out some TypeScript you are writing ;)

![](https://raw.githubusercontent.com/alm-tools/alm-tools.github.io/master/screens/tested/testedOverview.gif)

## Gutter
We show test statuses in the editor gutter ⚽.

## Test Results View
Clicking on the status bar section for testing or running the `Test Results View` command opens up a test browser.

![](https://raw.githubusercontent.com/alm-tools/alm-tools.github.io/master/screens/tested/liveUpdates.gif)

## Running without alm

Install `mocha` and `ts-node` and `typescript`. Now you can add something like the following to your package.json:

```
"test": "mocha --compilers ts:ts-node/register,tsx:ts-node/register"
```

now `npm run test` 🌹.

[stats]: http://www.npmtrends.com/mocha-vs-jasmine-vs-qunit-vs-jest-vs-ava
3 changes: 2 additions & 1 deletion nodemon.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"ignore": [
"src/app/*",
"tests/*"
"tests/*",
"alm.json"
]
}
12 changes: 9 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
"alm": "./bin/alm"
},
"scripts": {
"start": "nodemon",
"alm": "alm -o",
"test": "echo \"Testing is just build at the moment, run from prepublish\"",
"clean": "rm ./src/public/build/bundle.js",
"prepublish": "bash ./scripts/prepublish.sh",
Expand All @@ -16,6 +18,7 @@
"uts": "npm install typescript@next tslint@next byots@latest --save --save-exact && npm run tsc",
"umonaco": "npm install monaco@latest monaco-css@latest monaco-languages@latest --save --save-exact && npm run tsc",
"ureact": "npm install react@latest react-dom@latest --save-dev --save-exact",
"utest": "npm install ts-node@latest mocha@latest --save --save-exact && npm run tsc",
"preversion": "npm run tsc",
"postversion": "git push --follow-tags",
"mochaw": "mocha ./src/tests -w"
Expand Down Expand Up @@ -52,6 +55,7 @@
"glob": "^7.0.5",
"minimist": "^1.2.0",
"mkdirp": "^0.5.1",
"mocha": "3.0.2",
"monaco": "1.201608152240.0",
"monaco-css": "1.1.2",
"monaco-languages": "0.3.1",
Expand All @@ -63,14 +67,15 @@
"ora": "^0.2.0",
"rimraf": "^2.4.2",
"socket.io": "^1.3.6",
"tslint": "3.15.1",
"typescript": "2.1.0-dev.20160809",
"ts-node": "1.3.0",
"tslint": "3.15.0-dev.0",
"typescript": "2.1.0-dev.20160912",
"update-notifier": "1.0.2"
},
"devDependencies": {
"alm": "latest",
"clipboard": "^1.4.2",
"css-loader": "^0.24.0",
"csx": "4.0.0",
"d3": "^3.5.12",
"file-loader": "^0.8.4",
"font-awesome": "^4.4.0",
Expand All @@ -85,6 +90,7 @@
"marked": "^0.3.5",
"mocha": "^2.4.5",
"mousetrap": "^1.5.3",
"nodemon": "1.10.2",
"normalize.css": "^3.0.3",
"onresize": "^1.0.1",
"react": "15.3.1",
Expand Down
Loading