adapt-authoring-server 2.2.1 → 2.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adapt-authoring-server",
3
- "version": "2.2.1",
3
+ "version": "2.2.2",
4
4
  "description": "Provides an Express application routing and more",
5
5
  "homepage": "https://github.com/adapt-security/adapt-authoring-server",
6
6
  "license": "GPL-3.0",
@@ -118,14 +118,13 @@ describe('loadRouteConfig()', () => {
118
118
  )
119
119
  })
120
120
 
121
- it('should throw when routes.json fails schema validation (missing required root)', async () => {
121
+ it('should accept routes.json without root property', async () => {
122
122
  const dir = path.join(tmpDir, 'no-root')
123
123
  await mkdir(dir, { recursive: true })
124
124
  await writeJson(path.join(dir, 'routes.json'), { routes: [] })
125
- await assert.rejects(
126
- () => loadRouteConfig(dir, {}),
127
- /Invalid routes\.json.*must have required property 'root'/s
128
- )
125
+ const config = await loadRouteConfig(dir, {})
126
+ assert.ok(config !== null)
127
+ assert.equal(config.root, undefined)
129
128
  })
130
129
 
131
130
  it('should throw when routes.json fails schema validation (wrong type for root)', async () => {