mirror of
https://github.com/strapi/strapi.git
synced 2025-09-27 01:09:49 +00:00
Fix boostrap > bootstrap typo
This commit is contained in:
parent
bffa65ebc2
commit
7768f6076c
@ -71,12 +71,12 @@ describe('SSO', () => {
|
|||||||
jest.clearAllMocks();
|
jest.clearAllMocks();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Cannot register after boostrap', () => {
|
test('Cannot register after bootstrap', () => {
|
||||||
global.strapi = { isLoaded: true };
|
global.strapi = { isLoaded: true };
|
||||||
|
|
||||||
const fn = () => registry.register(fooProvider);
|
const fn = () => registry.register(fooProvider);
|
||||||
|
|
||||||
expect(fn).toThrowError(`You can't register new provider after the boostrap`);
|
expect(fn).toThrowError(`You can't register new provider after the bootstrap`);
|
||||||
expect(registry.size).toBe(0);
|
expect(registry.size).toBe(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ module.exports = () => {
|
|||||||
Object.assign(registry, {
|
Object.assign(registry, {
|
||||||
register(provider) {
|
register(provider) {
|
||||||
if (strapi.isLoaded) {
|
if (strapi.isLoaded) {
|
||||||
throw new Error(`You can't register new provider after the boostrap`);
|
throw new Error(`You can't register new provider after the bootstrap`);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.set(provider.uid, provider);
|
this.set(provider.uid, provider);
|
||||||
|
@ -57,7 +57,7 @@ class TransferEngine implements ITransferEngine {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
async boostrap(): Promise<void> {
|
async bootstrap(): Promise<void> {
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
// bootstrap source provider
|
// bootstrap source provider
|
||||||
this.sourceProvider.bootstrap?.(),
|
this.sourceProvider.bootstrap?.(),
|
||||||
@ -115,7 +115,7 @@ class TransferEngine implements ITransferEngine {
|
|||||||
async transfer(): Promise<void> {
|
async transfer(): Promise<void> {
|
||||||
try {
|
try {
|
||||||
// Bootstrap the providers
|
// Bootstrap the providers
|
||||||
await this.boostrap();
|
await this.bootstrap();
|
||||||
|
|
||||||
// Resolve providers' resource and store
|
// Resolve providers' resource and store
|
||||||
// them in the engine's internal state
|
// them in the engine's internal state
|
||||||
|
@ -6,7 +6,7 @@ import { collect, createMockedQueryBuilder, getStrapiFactory } from './test-util
|
|||||||
import { createLocalStrapiSourceProvider } from '../';
|
import { createLocalStrapiSourceProvider } from '../';
|
||||||
|
|
||||||
describe('Local Strapi Source Provider', () => {
|
describe('Local Strapi Source Provider', () => {
|
||||||
describe('Boostrap', () => {
|
describe('Bootstrap', () => {
|
||||||
test('Should not have a defined Strapi instance if bootstrap has not been called', () => {
|
test('Should not have a defined Strapi instance if bootstrap has not been called', () => {
|
||||||
const provider = createLocalStrapiSourceProvider({ getStrapi: getStrapiFactory() });
|
const provider = createLocalStrapiSourceProvider({ getStrapi: getStrapiFactory() });
|
||||||
|
|
||||||
@ -128,24 +128,24 @@ describe('Local Strapi Source Provider', () => {
|
|||||||
bar: { uid: 'bar', attributes: { age: { type: 'number' } } },
|
bar: { uid: 'bar', attributes: { age: { type: 'number' } } },
|
||||||
};
|
};
|
||||||
|
|
||||||
const components ={
|
const components = {
|
||||||
'basic.simple': {
|
'basic.simple': {
|
||||||
collectionName: 'components_basic_simples',
|
collectionName: 'components_basic_simples',
|
||||||
info: { displayName: 'simple', icon: 'ambulance', description: '' },
|
info: { displayName: 'simple', icon: 'ambulance', description: '' },
|
||||||
options: {},
|
options: {},
|
||||||
attributes: { name: {type:'string'} },
|
attributes: { name: { type: 'string' } },
|
||||||
uid: 'basic.simple',
|
uid: 'basic.simple',
|
||||||
category: 'basic',
|
category: 'basic',
|
||||||
modelType: 'component',
|
modelType: 'component',
|
||||||
modelName: 'simple',
|
modelName: 'simple',
|
||||||
globalId: 'ComponentBasicSimple'
|
globalId: 'ComponentBasicSimple',
|
||||||
},
|
},
|
||||||
'blog.test-como': {
|
'blog.test-como': {
|
||||||
collectionName: 'components_blog_test_comos',
|
collectionName: 'components_blog_test_comos',
|
||||||
info: {
|
info: {
|
||||||
displayName: 'test comp',
|
displayName: 'test comp',
|
||||||
icon: 'air-freshener',
|
icon: 'air-freshener',
|
||||||
description: ''
|
description: '',
|
||||||
},
|
},
|
||||||
options: {},
|
options: {},
|
||||||
attributes: { name: { type: 'string' } },
|
attributes: { name: { type: 'string' } },
|
||||||
@ -153,14 +153,16 @@ describe('Local Strapi Source Provider', () => {
|
|||||||
category: 'blog',
|
category: 'blog',
|
||||||
modelType: 'component',
|
modelType: 'component',
|
||||||
modelName: 'test-como',
|
modelName: 'test-como',
|
||||||
globalId: 'ComponentBlogTestComo'
|
globalId: 'ComponentBlogTestComo',
|
||||||
},
|
},
|
||||||
}
|
};
|
||||||
|
|
||||||
const provider = createLocalStrapiSourceProvider({ getStrapi: getStrapiFactory({
|
const provider = createLocalStrapiSourceProvider({
|
||||||
contentTypes,
|
getStrapi: getStrapiFactory({
|
||||||
components
|
contentTypes,
|
||||||
}) });
|
components,
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
|
||||||
await provider.bootstrap();
|
await provider.bootstrap();
|
||||||
|
|
||||||
@ -177,19 +179,19 @@ describe('Local Strapi Source Provider', () => {
|
|||||||
collectionName: 'components_basic_simples',
|
collectionName: 'components_basic_simples',
|
||||||
info: { displayName: 'simple', icon: 'ambulance', description: '' },
|
info: { displayName: 'simple', icon: 'ambulance', description: '' },
|
||||||
options: {},
|
options: {},
|
||||||
attributes: { name: {type:'string'} },
|
attributes: { name: { type: 'string' } },
|
||||||
uid: 'basic.simple',
|
uid: 'basic.simple',
|
||||||
category: 'basic',
|
category: 'basic',
|
||||||
modelType: 'component',
|
modelType: 'component',
|
||||||
modelName: 'simple',
|
modelName: 'simple',
|
||||||
globalId: 'ComponentBasicSimple'
|
globalId: 'ComponentBasicSimple',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
collectionName: 'components_blog_test_comos',
|
collectionName: 'components_blog_test_comos',
|
||||||
info: {
|
info: {
|
||||||
displayName: 'test comp',
|
displayName: 'test comp',
|
||||||
icon: 'air-freshener',
|
icon: 'air-freshener',
|
||||||
description: ''
|
description: '',
|
||||||
},
|
},
|
||||||
options: {},
|
options: {},
|
||||||
attributes: { name: { type: 'string' } },
|
attributes: { name: { type: 'string' } },
|
||||||
@ -197,9 +199,9 @@ describe('Local Strapi Source Provider', () => {
|
|||||||
category: 'blog',
|
category: 'blog',
|
||||||
modelType: 'component',
|
modelType: 'component',
|
||||||
modelName: 'test-como',
|
modelName: 'test-como',
|
||||||
globalId: 'ComponentBlogTestComo'
|
globalId: 'ComponentBlogTestComo',
|
||||||
}
|
},
|
||||||
])
|
]);
|
||||||
});
|
});
|
||||||
})
|
});
|
||||||
});
|
});
|
||||||
|
@ -39,7 +39,7 @@ export interface ITransferEngine {
|
|||||||
* Note: The bootstrap method can be used to initialize database
|
* Note: The bootstrap method can be used to initialize database
|
||||||
* connections, open files, etc...
|
* connections, open files, etc...
|
||||||
*/
|
*/
|
||||||
boostrap(): Promise<void>;
|
bootstrap(): Promise<void>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Run the close lifecycle method of each provider
|
* Run the close lifecycle method of each provider
|
||||||
|
Loading…
x
Reference in New Issue
Block a user