Taichi Masuyama 4 лет назад
Родитель
Сommit
bbac5a905b

+ 1 - 6
packages/app/test/integration/service/v5.migration.test.js

@@ -26,7 +26,7 @@ describe('V5 page migration', () => {
       jest.restoreAllMocks();
 
       // initialize pages for test
-      let pages = await Page.insertMany([
+      const pages = await Page.insertMany([
         {
           path: '/private1',
           grant: Page.GRANT_OWNER,
@@ -57,11 +57,6 @@ describe('V5 page migration', () => {
         },
       ]);
 
-      if (!await Page.exists({ path: '/' })) {
-        const additionalPages = await Page.insertMany([{ path: '/', grant: Page.GRANT_PUBLIC }]);
-        pages = [...additionalPages, ...pages];
-      }
-
       const pageIds = pages.map(page => page._id);
       // migrate
       await crowi.pageService.normalizeParentRecursivelyByPageIds(pageIds, testUser1);

+ 0 - 37
packages/app/test/integration/v5-page-global-setup.js

@@ -1,37 +0,0 @@
-/** **********************************************************
- *                           Caution
- *
- * Module aliases by compilerOptions.paths in tsconfig.json
- * are NOT available in setup scripts
- *********************************************************** */
-
-import 'tsconfig-paths/register';
-
-import mongoose from 'mongoose';
-
-import { initMongooseGlobalSettings, getMongoUri, mongoOptions } from '@growi/core';
-
-// check env
-if (process.env.NODE_ENV !== 'test') {
-  throw new Error('\'process.env.NODE_ENV\' must be \'test\'');
-}
-
-
-// eslint-disable-next-line @typescript-eslint/no-var-requires
-// const { getInstance } = require('./setup-crowi');
-
-module.exports = async() => {
-  initMongooseGlobalSettings();
-  process.env.MONGO_URI = 'mongodb://mongo/growi_pagev5_test';
-  await mongoose.connect(getMongoUri(), mongoOptions);
-
-  // drop database
-  await mongoose.connection.dropDatabase();
-
-  // init DB
-  // const crowi = await getInstance();
-  // const appService = crowi.appService;
-  // await appService.initDB();
-
-  await mongoose.disconnect();
-};

+ 0 - 26
packages/app/test/integration/v5-page-setup.js

@@ -1,26 +0,0 @@
-/** **********************************************************
- *                           Caution
- *
- * Module aliases by compilerOptions.paths in tsconfig.json
- * are NOT available in setup scripts
- *********************************************************** */
-
-const mongoose = require('mongoose');
-
-const { initMongooseGlobalSettings, getMongoUri, mongoOptions } = require('@growi/core');
-
-mongoose.Promise = global.Promise;
-
-jest.setTimeout(30000); // default 5000
-
-beforeAll(async() => {
-  initMongooseGlobalSettings();
-  process.env.MONGO_URI = 'mongodb://mongo/growi_pagev5_test';
-  await mongoose.connect(getMongoUri(), mongoOptions);
-});
-
-afterAll(async() => {
-  await mongoose.disconnect();
-});
-
-module.exports = {};