Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b0a0598
commit a18d8dc
Showing
17 changed files
with
300 additions
and
236 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module.exports = { | ||
description: 'throws for invalid top-level-await format', | ||
options: { | ||
experimentalTopLevelAwait: true | ||
}, | ||
generateError: { | ||
code: 'INVALID_TLA_FORMAT', | ||
message: | ||
'Module format cjs does not support top-level await. Use the "es" or "system" output formats rather.' | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
await Promise.resolve(); |
18 changes: 18 additions & 0 deletions
18
test/function/samples/plugin-cache/anonymous-delete/_config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
module.exports = { | ||
description: 'throws for anonymous plugins deleting from the cache', | ||
options: { | ||
plugins: { | ||
buildStart() { | ||
this.cache.delete('asdf'); | ||
} | ||
} | ||
}, | ||
error: { | ||
code: 'PLUGIN_ERROR', | ||
hook: 'buildStart', | ||
message: | ||
'A plugin is trying to use the Rollup cache but is not declaring a plugin name or cacheKey.', | ||
plugin: 'at position 1', | ||
pluginCode: 'ANONYMOUS_PLUGIN_CACHE' | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
assert.equal( 1, 1 ); |
18 changes: 18 additions & 0 deletions
18
test/function/samples/plugin-cache/anonymous-get/_config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
module.exports = { | ||
description: 'throws for anonymous plugins reading the cache', | ||
options: { | ||
plugins: { | ||
buildStart() { | ||
this.cache.get('asdf'); | ||
} | ||
} | ||
}, | ||
error: { | ||
code: 'PLUGIN_ERROR', | ||
hook: 'buildStart', | ||
message: | ||
'A plugin is trying to use the Rollup cache but is not declaring a plugin name or cacheKey.', | ||
plugin: 'at position 1', | ||
pluginCode: 'ANONYMOUS_PLUGIN_CACHE' | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
assert.equal( 1, 1 ); |
18 changes: 18 additions & 0 deletions
18
test/function/samples/plugin-cache/anonymous-has/_config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
module.exports = { | ||
description: 'throws for anonymous plugins checking the cache', | ||
options: { | ||
plugins: { | ||
buildStart() { | ||
this.cache.has('asdf'); | ||
} | ||
} | ||
}, | ||
error: { | ||
code: 'PLUGIN_ERROR', | ||
hook: 'buildStart', | ||
message: | ||
'A plugin is trying to use the Rollup cache but is not declaring a plugin name or cacheKey.', | ||
plugin: 'at position 1', | ||
pluginCode: 'ANONYMOUS_PLUGIN_CACHE' | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
assert.equal( 1, 1 ); |
18 changes: 18 additions & 0 deletions
18
test/function/samples/plugin-cache/anonymous-set/_config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
module.exports = { | ||
description: 'throws for anonymous plugins adding to the cache', | ||
options: { | ||
plugins: { | ||
buildStart() { | ||
this.cache.set('asdf', 'asdf'); | ||
} | ||
} | ||
}, | ||
error: { | ||
code: 'PLUGIN_ERROR', | ||
hook: 'buildStart', | ||
message: | ||
'A plugin is trying to use the Rollup cache but is not declaring a plugin name or cacheKey.', | ||
plugin: 'at position 1', | ||
pluginCode: 'ANONYMOUS_PLUGIN_CACHE' | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
assert.equal( 1, 1 ); |
15 changes: 15 additions & 0 deletions
15
test/function/samples/plugin-cache/duplicate-names-no-cache/_config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module.exports = { | ||
description: 'allows plugins to have the same name if they do not access the cache', | ||
options: { | ||
plugins: [ | ||
{ | ||
name: 'test-plugin', | ||
buildStart() {} | ||
}, | ||
{ | ||
name: 'test-plugin', | ||
buildStart() {} | ||
} | ||
] | ||
} | ||
}; |
1 change: 1 addition & 0 deletions
1
test/function/samples/plugin-cache/duplicate-names-no-cache/main.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
assert.equal( 1, 1 ); |
27 changes: 27 additions & 0 deletions
27
test/function/samples/plugin-cache/duplicate-names/_config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
module.exports = { | ||
description: 'throws if two plugins with the same name and no cache key access the cache', | ||
options: { | ||
plugins: [ | ||
{ | ||
name: 'test-plugin', | ||
buildStart() { | ||
this.cache.set('asdf', 'asdf'); | ||
} | ||
}, | ||
{ | ||
name: 'test-plugin', | ||
buildStart() { | ||
this.cache.set('asdf', 'asdf'); | ||
} | ||
} | ||
] | ||
}, | ||
error: { | ||
code: 'PLUGIN_ERROR', | ||
hook: 'buildStart', | ||
message: | ||
'The plugin name test-plugin is being used twice in the same build. Plugin names must be distinct or provide a cacheKey (please post an issue to the plugin if you are a plugin user).', | ||
plugin: 'test-plugin', | ||
pluginCode: 'DUPLICATE_PLUGIN_NAME' | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
assert.equal( 1, 1 ); |
Oops, something went wrong.