22layout : default
33title : Getting started
44nav_order : 2
5- permalink : /docs
65---
76
87This guide walks you through adding marklogic-unit-test to an existing project, followed by writing, loading, and
@@ -40,7 +39,7 @@ in your `build.gradle` file), run the following task to install marklogic-unit-t
4039
4140 ./gradlew -i mlLoadModules
4241
43- If you would like to [ run your marklogic-unit-test tests] ( /docs/ running) via Gradle, you'll also need to include the
42+ If you would like to [ run your marklogic-unit-test tests] ( running-tests.md ) via Gradle, you'll also need to include the
4443following at the top of your ` build.gradle ` file:
4544
4645```
@@ -90,7 +89,7 @@ therefore be stored in the `src/test/ml-modules/root/test/suites/(name of suite)
9089
9190A test suite can have any name; for this example, we will use "thesaurus" as the name. Test modules can have any name
9291as well with a few exceptions for setup and teardown modules; those exceptions are covered in the
93- [ guide for writing tests] ( /docs/ writing) . We will use "simple-test.sjs" for this example, so we create a
92+ [ guide for writing tests] ( writing-tests.md ) . We will use "simple-test.sjs" for this example, so we create a
9493file at ` src/test/ml-modules/root/test/suites/thesaurus/simple-test.sjs ` with the following initial content:
9594
9695```
@@ -99,7 +98,7 @@ const lib = require("/example/lib.sjs");
9998```
10099
101100The first line above imports the marklogic-unit-test module containing dozens of useful
102- [ assertion functions] ( /docs/assertions ) ; every test
101+ [ assertion functions] ( assertion-functions.md ) ; every test
103102module will need this imported. The second line imports the library module that we wish to verify.
104103
105104Next, add the following text to the file:
@@ -116,7 +115,7 @@ const result = lib.lookupTerm("Car");
116115The above code will invoke the ` lookupTerm ` function that we wish to test with a term that we know is in the
117116application's thesaurus. Each ` assertEqual ` function call - along with every other assertion function in
118117marklogic-unit-test - will return a success or failure. The test then returns an array of these successes and failures.
119- The different approaches for [ running tests] ( /docs/ running) know how to collect these results and display how many
118+ The different approaches for [ running tests] ( running-tests.md ) know how to collect these results and display how many
120119tests passed and how many failed.
121120
122121## Configuring a connection to MarkLogic
@@ -163,7 +162,7 @@ Once you execute either `mlWatch` or `mlLoadModules`, your test will be ready to
163162
164163## Running a test
165164
166- marklogic-unit-test provides [ several ways to run tests] ( /docs/ running) . We will look at the two primary ways to
165+ marklogic-unit-test provides [ several ways to run tests] ( running-tests.md ) . We will look at the two primary ways to
167166run the test module we just wrote and loaded into our application's modules database.
168167
169168First, tests can be run via the ml-gradle ` mlUnitTest ` task, as long as you have included the
@@ -217,6 +216,6 @@ This guide has covered the following topics:
2172163 . How to load a test.
2182174 . How to run a test.
219218
220- With the above information and the references on [ writing tests] ( /docs/ writing) and
221- [ running tests] ( /docs/ running) , you can now start writing tests for the library modules in your application,
219+ With the above information and the references on [ writing tests] ( writing-tests.md ) and
220+ [ running tests] ( running-tests.md ) , you can now start writing tests for the library modules in your application,
222221ensuring that you can quickly enhance your application without breaking any existing functionality.
0 commit comments