src/core/test-helpers/model-versions/README.md
Package exposing utilities for model version testing:
The createModelVersionTestMigrator helper allows to create a test migrator that
can be used to test model version changes between versions.
const mySoType = someSoType();
const migrator = createModelVersionTestMigrator({ type: mySoType });
const obj = createSomeSavedObject();
const migrated = migrator.migrate({
document: obj,
fromVersion: 1,
toVersion: 2,
});
expect(migrated.properties).toEqual(myExpectedProperties);
Please refer to the code documentation for more detailed examples.
This package exposes a createModelVersionTestBed utility which allow simulating
a testbed environment where we're in the cohabitation period between two versions, to test the interactions
between two model versions of a set of SO types.
Please refer to the code documentation for more detailed examples.
Limitations:
Because the test bed is only creating the parts of Core required to create the two SO repositories, and because we're not loading all plugins (for proper isolation), the integration test bed has some limitations: