We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c6d5611 commit d4173efCopy full SHA for d4173ef
1 file changed
lib/cmd/vite/plugins/client-env.test.js
@@ -48,20 +48,12 @@ describe('createClientEnvCollector', () => {
48
});
49
50
it('transform collects a single env var reference', () => {
51
- const collector = createClientEnvCollector(tmpOutputPath());
+ const out = tmpOutputPath();
52
+ const collector = createClientEnvCollector(out);
53
const p = collector.plugin();
54
55
p.transform('const x = process.env.MY_VAR;');
-
56
- const vars = [];
57
58
- // Inspect by writing to disk
59
- const out = tmpOutputPath();
60
- const c2 = createClientEnvCollector(out);
61
- const p2 = c2.plugin();
62
63
- p2.transform('const x = process.env.MY_VAR;');
64
- return c2.write().then(result => {
+ return collector.write().then(result => {
65
expect(result).toEqual(['MY_VAR']);
66
67
0 commit comments