Web Development with Julia and Genie by Ivo Balbaert & Adrian Salceanu
Author:Ivo Balbaert & Adrian Salceanu
Language: eng
Format: epub
Publisher: Packt
Published: 2022-12-15T00:00:00+00:00
Writing and running our first tests
There are multiple types of tests, some of the most common ones being unit tests and integration tests. Unit tests are tests that test the behavior of a single piece of code. Integration tests are tests that test the behavior of a whole application. When it comes to MVC applications, unit tests are usually focused on testing the models, while integration tests cover larger features that involve at least two layers of the MVC stack.
If you check the test/ folder, you will see that a test file has already been added, called todos_test.jl. This was created automatically by SearchLight when we created our model. The file doesnât include any meaningful tests (thatâs our job!), but we already have more than enough to get us started.
The todos_test.jl test file includes the necessary dependencies and defines a test set with a basic test:
using Test, SearchLight, Main.UserApp, Main.UserApp.Todos @testset "Todo unit tests" begin ### Your tests here @test 1 == 1 end;
Letâs make sure that everything is working as expected. We can run the tests by executing the runtests.jl file in the test folder, as follows:
julia --project runtests.jl
Our tests run successfully, as shown by the following output:
todos_test: . Test Summary: | Pass Total Time TodoMVC tests | 1 1 0.8s
But looking at our output, we can see that an exception has been thrown while loading the appâs initializers:
Loading initializers ERROR: SearchLight.Exceptions.MissingDatabaseConfigurationException("DB configuration for test not found") ...output omitted ... in expression starting at TodoMVC/config/initializers/searchlight.jl:13
Weâll address this exception next.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Web Development with Julia and Genie by Ivo Balbaert & Adrian Salceanu(5733)
State Management with React Query by Daniel Afonso(3224)
Eleventy by Example by Robinson Bryan;(3156)
Architecting Vue.js 3 Enterprise-Ready Web Applications by Solomon Eseme(2854)
Digital Marketing with Drupal by José Fernandes(2811)
Building Python Web APIs with FastAPI by Abdulazeez Abdulazeez Adeshina(2757)
Becoming an Enterprise Django Developer by Michael Dinder(1224)
Building Python Web APIs with FastAPI: A fast-paced guide to building high-performance, robust web APIs with very little boilerplate code by Abdulazeez Abdulazeez Adeshina(1161)
Operator Training Simulator Handbook by Joseph Philip(1130)
Practical WebAssembly: Explore the fundamentals of WebAssembly programming using Rust by Sendil Kumar Nellaiyapen(1054)
Google Workspace User Guide: A Practical Guide to Using Google Workspace Apps Efficiently While Integrating Them With Your Data by Balaji Iyer(1044)
Hands-on Cloud Analytics with Microsoft Azure Stack: Transform Your Data to Derive Powerful Insights Using Microsoft Azure by Prashila Naik(1025)
Building SPAs with Django and HTML Over the Wire: Learn to build real-time single page applications with Python by Andros Fenollosa(974)
State Management with React Query by Afonso Daniel;(941)
Modern Frontend Development with Node.js by Florian Rappl(907)
High Performance with Laravel Octane by R. Butti(896)
Kubernetes Design Patterns and Extensions by Onur Yilmaz(888)
JavaScript from Frontend to Backend by Unknown(794)
Building Data Science Applications with FastAPI by François Voron(761)
