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