From 254026860cfac4a19368b137868413e5b63cd646 Mon Sep 17 00:00:00 2001 From: jaywcjlove <398188662@qq.com> Date: Fri, 1 Sep 2023 10:17:34 +0800 Subject: [PATCH] test: update test case. --- test/cases/cjs-import-css/output.js | 1 - test/cases/cjs-import-less/output.js | 3 --- .../cjs-remove-require-side-effect/output.js | 13 ++++++++----- test/cases/cjs-remove-require/output.js | 17 +++++++++++------ test/cases/import-less/output.js | 2 -- test/cases/options-test/output.js | 1 - test/cases/remove-all/output.js | 1 - 7 files changed, 19 insertions(+), 19 deletions(-) diff --git a/test/cases/cjs-import-css/output.js b/test/cases/cjs-import-css/output.js index 63c85fe9..24b8b300 100644 --- a/test/cases/cjs-import-css/output.js +++ b/test/cases/cjs-import-css/output.js @@ -1,5 +1,4 @@ "use strict"; var _uiw = require("uiw"); - var _core = require("@uiw/core"); \ No newline at end of file diff --git a/test/cases/cjs-import-less/output.js b/test/cases/cjs-import-less/output.js index cfad3194..ce0e41ef 100644 --- a/test/cases/cjs-import-less/output.js +++ b/test/cases/cjs-import-less/output.js @@ -1,11 +1,8 @@ "use strict"; var _uiw = require("uiw"); - var _core = require("@uiw/core"); - function TestFun() { console.log('~~~:', _uiw.Button); } - TestFun(); \ No newline at end of file diff --git a/test/cases/cjs-remove-require-side-effect/output.js b/test/cases/cjs-remove-require-side-effect/output.js index cd5114c2..bce58e94 100644 --- a/test/cases/cjs-remove-require-side-effect/output.js +++ b/test/cases/cjs-remove-require-side-effect/output.js @@ -1,15 +1,18 @@ var a = 1; -var b = 2; // Variable declarations +var b = 2; -var core = require('@babel/core'); // Using as argument to a function +// Variable declarations +var core = require('@babel/core'); +// Using as argument to a function +useCore(require('@babel/core')); -useCore(require('@babel/core')); // A clear side-effect expression (SHOULD be removed) +// A clear side-effect expression (SHOULD be removed) // Non-matching module ID require('jest'); - console.log(a + b); // 3 -function useCore() {// do something with it +function useCore() { + // do something with it } \ No newline at end of file diff --git a/test/cases/cjs-remove-require/output.js b/test/cases/cjs-remove-require/output.js index df0fdd5a..a3d66db6 100644 --- a/test/cases/cjs-remove-require/output.js +++ b/test/cases/cjs-remove-require/output.js @@ -1,16 +1,21 @@ var a = 1; -var b = 2; // Variable declarations (SHOULD be removed) +var b = 2; -var core; // Using non-require function +// Variable declarations (SHOULD be removed) +var core; -var something = useCore('@babel/core'); // Using as argument to a function (SHOULD be removed) +// Using non-require function +var something = useCore('@babel/core'); -useCore(); // A clear side-effect expression (SHOULD be removed) +// Using as argument to a function (SHOULD be removed) +useCore(); + +// A clear side-effect expression (SHOULD be removed) // Non-matching module ID require('jest'); - console.log(a + b); // 3 -function useCore(arg0) {// do something with it +function useCore(arg0) { + // do something with it } \ No newline at end of file diff --git a/test/cases/import-less/output.js b/test/cases/import-less/output.js index d94f4531..ccc944df 100644 --- a/test/cases/import-less/output.js +++ b/test/cases/import-less/output.js @@ -1,8 +1,6 @@ import { Button } from 'uiw'; import { Select } from '@uiw/core'; - function TestFun() { console.log('~~~:', Button); } - TestFun(); \ No newline at end of file diff --git a/test/cases/options-test/output.js b/test/cases/options-test/output.js index 2d44acc3..27e32dc7 100644 --- a/test/cases/options-test/output.js +++ b/test/cases/options-test/output.js @@ -1,5 +1,4 @@ "use strict"; var _uiw; - var _core; \ No newline at end of file diff --git a/test/cases/remove-all/output.js b/test/cases/remove-all/output.js index c27330b1..f0447f7a 100644 --- a/test/cases/remove-all/output.js +++ b/test/cases/remove-all/output.js @@ -1,5 +1,4 @@ function TestFun() { console.log('~~~:', Button); } - TestFun(); \ No newline at end of file