Files
hive/mcp-server/node_modules/lunr/test/utils_test.js
anthonyrawlins e89f2f4b7b Add comprehensive development roadmap via GitHub Issues
Created 10 detailed GitHub issues covering:
- Project activation and management UI (#1-2)
- Worker node coordination and visualization (#3-4)
- Automated GitHub repository scanning (#5)
- Intelligent model-to-issue matching (#6)
- Multi-model task execution system (#7)
- N8N workflow integration (#8)
- Hive-Bzzz P2P bridge (#9)
- Peer assistance protocol (#10)

Each issue includes detailed specifications, acceptance criteria,
technical implementation notes, and dependency mapping.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-12 19:41:01 +10:00

78 lines
1.8 KiB
JavaScript

suite('lunr.utils', function () {
suite('#clone', function () {
var subject = function (obj) {
setup(function () {
this.obj = obj
this.clone = lunr.utils.clone(obj)
})
}
suite('handles null', function () {
subject(null)
test('returns null', function () {
assert.equal(null, this.clone)
assert.equal(this.obj, this.clone)
})
})
suite('handles undefined', function () {
subject(undefined)
test('returns null', function () {
assert.equal(undefined, this.clone)
assert.equal(this.obj, this.clone)
})
})
suite('object with primatives', function () {
subject({
number: 1,
string: 'foo',
bool: true
})
test('clones number correctly', function () {
assert.equal(this.obj.number, this.clone.number)
})
test('clones string correctly', function () {
assert.equal(this.obj.string, this.clone.string)
})
test('clones bool correctly', function () {
assert.equal(this.obj.bool, this.clone.bool)
})
})
suite('object with array property', function () {
subject({
array: [1, 2, 3]
})
test('clones array correctly', function () {
assert.deepEqual(this.obj.array, this.clone.array)
})
test('mutations on clone do not affect orginial', function () {
this.clone.array.push(4)
assert.notDeepEqual(this.obj.array, this.clone.array)
assert.equal(this.obj.array.length, 3)
assert.equal(this.clone.array.length, 4)
})
})
suite('nested object', function () {
test('throws type error', function () {
assert.throws(function () {
lunr.utils.clone({
'foo': {
'bar': 1
}
})
}, TypeError)
})
})
})
})