1
1
import fs from 'fs' ;
2
2
import path from 'path' ;
3
+ import { isVersionAtLeast18 } from '@modern-js/utils' ;
3
4
import puppeteer from 'puppeteer' ;
4
5
import {
5
6
getPort ,
@@ -22,6 +23,7 @@ function existsSync(filePath: string) {
22
23
23
24
describe ( 'devtools build' , ( ) => {
24
25
test ( `should get right devtools build!` , async ( ) => {
26
+ if ( ! isVersionAtLeast18 ( ) ) return ;
25
27
const buildRes = await modernBuild ( appDir ) ;
26
28
expect ( buildRes . code === 0 ) . toBe ( true ) ;
27
29
expect ( existsSync ( 'route.json' ) ) . toBe ( true ) ;
@@ -35,6 +37,7 @@ describe('devtools build', () => {
35
37
} ) ;
36
38
37
39
it ( 'should get image url with production CDN' , async ( ) => {
40
+ if ( ! isVersionAtLeast18 ( ) ) return ;
38
41
const appPort = await getPort ( ) ;
39
42
const app = await modernServe ( appDir , appPort ) ;
40
43
const errors : string [ ] = [ ] ;
@@ -60,6 +63,7 @@ describe('devtools build', () => {
60
63
61
64
describe ( 'devtools dev' , ( ) => {
62
65
test ( `should render page correctly` , async ( ) => {
66
+ if ( ! isVersionAtLeast18 ( ) ) return ;
63
67
const appPort = await getPort ( ) ;
64
68
const app = await launchApp (
65
69
appDir ,
0 commit comments