22layout : default
33title : Getting started
44nav_order : 2
5+ [comment] : " /docs" is used to preserve links to previous set of docs.
6+ permalink : /docs
57---
68
79This guide walks you through adding marklogic-unit-test to an existing project, followed by writing, loading, and
@@ -39,7 +41,7 @@ in your `build.gradle` file), run the following task to install marklogic-unit-t
3941
4042 ./gradlew -i mlLoadModules
4143
42- If you would like to [ run your marklogic-unit-test tests] ( running-tests.md ) via Gradle, you'll also need to include the
44+ If you would like to [ run your marklogic-unit-test tests] ( /docs/ running) via Gradle, you'll also need to include the
4345following at the top of your ` build.gradle ` file:
4446
4547```
@@ -89,7 +91,7 @@ therefore be stored in the `src/test/ml-modules/root/test/suites/(name of suite)
8991
9092A test suite can have any name; for this example, we will use "thesaurus" as the name. Test modules can have any name
9193as well with a few exceptions for setup and teardown modules; those exceptions are covered in the
92- [ guide for writing tests] ( writing-tests.md ) . We will use "simple-test.sjs" for this example, so we create a
94+ [ guide for writing tests] ( /docs/ writing) . We will use "simple-test.sjs" for this example, so we create a
9395file at ` src/test/ml-modules/root/test/suites/thesaurus/simple-test.sjs ` with the following initial content:
9496
9597```
@@ -98,7 +100,7 @@ const lib = require("/example/lib.sjs");
98100```
99101
100102The first line above imports the marklogic-unit-test module containing dozens of useful
101- [ assertion functions] ( assertion-functions.md ) ; every test
103+ [ assertion functions] ( /docs/assertions ) ; every test
102104module will need this imported. The second line imports the library module that we wish to verify.
103105
104106Next, add the following text to the file:
@@ -115,7 +117,7 @@ const result = lib.lookupTerm("Car");
115117The above code will invoke the ` lookupTerm ` function that we wish to test with a term that we know is in the
116118application's thesaurus. Each ` assertEqual ` function call - along with every other assertion function in
117119marklogic-unit-test - will return a success or failure. The test then returns an array of these successes and failures.
118- The different approaches for [ running tests] ( running-tests.md ) know how to collect these results and display how many
120+ The different approaches for [ running tests] ( /docs/ running) know how to collect these results and display how many
119121tests passed and how many failed.
120122
121123## Configuring a connection to MarkLogic
@@ -162,7 +164,7 @@ Once you execute either `mlWatch` or `mlLoadModules`, your test will be ready to
162164
163165## Running a test
164166
165- marklogic-unit-test provides [ several ways to run tests] ( running-tests.md ) . We will look at the two primary ways to
167+ marklogic-unit-test provides [ several ways to run tests] ( /docs/ running) . We will look at the two primary ways to
166168run the test module we just wrote and loaded into our application's modules database.
167169
168170First, tests can be run via the ml-gradle ` mlUnitTest ` task, as long as you have included the
@@ -216,6 +218,6 @@ This guide has covered the following topics:
2162183 . How to load a test.
2172194 . How to run a test.
218220
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,
221+ With the above information and the references on [ writing tests] ( /docs/ writing) and
222+ [ running tests] ( /docs/ running) , you can now start writing tests for the library modules in your application,
221223ensuring that you can quickly enhance your application without breaking any existing functionality.
0 commit comments