1.0.0 • Published 1 year ago
@enonic/mock-xp v1.0.0
@enonic/mock-xp
Library to mock Enonic XP API's and state.
Used to run tests in node, without the need to run Enonic XP.
Usage
import {deepStrictEqual} from 'assert';
import {
LibNode,
Server
} from '@enonic/mock-xp';
const APP_NAME = 'com.enonic.app.example';
const server = new Server().createRepo({id: APP_NAME});
const libNode = new LibNode({
server
});
describe('whatever', () => {
it(`is correct`, () => {
const connection = libNode.connect({
repoId: APP_NAME,
branch: 'master'
});
const FOLDER_NAME = 'folderName';
const createdNode = connection.create({
_name: FOLDER_NAME
});
deepStrictEqual(
{
_id: createdNode._id,
_indexConfig: {
configs: [],
default: {
decideByType: true,
enabled: true,
fulltext: false,
includeInAllText: false,
indexValueProcessors: [],
languages: [],
nGram: false,
path: false,
},
},
_name: FOLDER_NAME,
_path: createdNode._path,
_nodeType: 'default',
_state: 'DEFAULT',
_ts: createdNode._ts,
_versionKey: createdNode._versionKey,
},
createdNode
);
});
});
1.0.0
1 year ago
1.0.0-RC1
1 year ago
1.0.0-B1
1 year ago
0.10.0
2 years ago
0.9.0
2 years ago
0.8.1
2 years ago
0.8.0
2 years ago
0.9.1
2 years ago
0.7.0
2 years ago
0.6.1
2 years ago
0.5.2
2 years ago
0.6.0
2 years ago
0.5.1
2 years ago
0.5.0
2 years ago
0.4.0
2 years ago
0.3.0
3 years ago
0.2.0
3 years ago
0.3.1
3 years ago
0.1.3
3 years ago
0.1.2
3 years ago
0.1.1
3 years ago
0.1.0
3 years ago