Highlight some code-blocks with 'console' label
Update the dracula theme styles to make 'console' highlighting more legible
This commit is contained in:
@@ -51,7 +51,7 @@ end
|
||||
|
||||
Let's try running the test.
|
||||
|
||||
```
|
||||
```console
|
||||
$ docker run --rm -w /opt -v $PWD:/opt hw_dev mix test
|
||||
running build task
|
||||
...
|
||||
@@ -197,7 +197,7 @@ File.write("index.html", """
|
||||
|
||||
After running the test,
|
||||
|
||||
```
|
||||
```console
|
||||
$ docker run --rm -w /opt -v $PWD:/opt hw_dev mix test
|
||||
running build task
|
||||
...
|
||||
@@ -207,7 +207,7 @@ Finished in 0.02 seconds (0.02s async, 0.00s sync)
|
||||
|
||||
we have our test directory, `test/mix/tmp`,
|
||||
|
||||
```
|
||||
```console
|
||||
$ find test/mix/tmp
|
||||
test/mix/tmp
|
||||
test/mix/tmp/build
|
||||
@@ -218,7 +218,7 @@ test/mix/tmp/build/index.html
|
||||
|
||||
and our fixture file.
|
||||
|
||||
```
|
||||
```console
|
||||
$ cat test/mix/tmp/build/index.html
|
||||
<!-- Auto-generated fixture -->
|
||||
<!DOCTYPE html>
|
||||
@@ -240,7 +240,7 @@ end)
|
||||
|
||||
Now, after we run the tests, all the files and directories created during the test run have been removed.
|
||||
|
||||
```
|
||||
```console
|
||||
$ find test/mix/tmp/
|
||||
find: ‘test/mix/tmp/’: No such file or directory
|
||||
```
|
||||
@@ -258,7 +258,7 @@ capture_io(fn -> Mix.Tasks.Build.run([]) end)
|
||||
|
||||
When we run our tests now, there are no more IO messages cluttering up the test results.
|
||||
|
||||
```
|
||||
```console
|
||||
$ docker run --rm -w /opt -v $PWD:/opt hw_dev mix test
|
||||
...
|
||||
Finished in 0.02 seconds (0.02s async, 0.00s sync)
|
||||
@@ -319,4 +319,4 @@ end
|
||||
|
||||
## Conclusion
|
||||
|
||||
This test seemed trivial at first, but increased in complexity quickly. We had to set some of our configuration in application environment variables, change the configuration temporarily before a test run and then change it back after, clean up test artifacts after the run, and capture IO messages that were generated during it. That's enough going on that we thought it would be a good topic for a post. Cheers and happy coding!
|
||||
This test seemed trivial at first, but increased in complexity quickly. We had to set some of our configuration in application environment variables, change the configuration temporarily before a test run and then change it back after, clean up test artifacts after the run, and capture IO messages that were generated during it. That's enough going on that we thought it would be a good topic for a post. Cheers and happy coding!
|
||||
|
||||
Reference in New Issue
Block a user