1.0.0 • Published 15 days ago

@enonic/mock-xp v1.0.0

Weekly downloads
-
License
GPL-3.0
Repository
-
Last release
15 days ago

@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

15 days ago

1.0.0-RC1

22 days ago

1.0.0-B1

1 month ago

0.10.0

9 months ago

0.9.0

9 months ago

0.8.1

10 months ago

0.8.0

10 months ago

0.9.1

9 months ago

0.7.0

10 months ago

0.6.1

10 months ago

0.5.2

10 months ago

0.6.0

10 months ago

0.5.1

10 months ago

0.5.0

10 months ago

0.4.0

12 months ago

0.3.0

2 years ago

0.2.0

2 years ago

0.3.1

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago