refactor: added ACI prefix to avoid external conflicts

This commit is contained in:
arthurfiorette 2022-01-23 16:18:00 -03:00
parent 0ba6025fb5
commit ea4ab4c4eb
No known key found for this signature in database
GPG Key ID: 9D190CD53C53C555
4 changed files with 8 additions and 8 deletions

View File

@ -82,7 +82,7 @@ const config = ({
minimizer: [new TerserWebpackPlugin({ parallel: true })]
},
plugins: [new DefinePlugin({ __DEV__: devBuild })]
plugins: [new DefinePlugin({ __ACI_DEV__: devBuild })]
});
module.exports = [

View File

@ -25,10 +25,10 @@ declare global {
*
* @internal
*/
const __DEV__: boolean;
const __ACI_DEV__: boolean;
}
if (__DEV__) {
if (__ACI_DEV__) {
console.error(
'You are using a development build. Make sure to use the correct build in production'
);

View File

@ -1,8 +1,8 @@
export {};
describe('tests __DEV__ usage', () => {
it('expects importing with __DEV__ true prints a warning', async () => {
expect(__DEV__).toBeTruthy();
describe('tests __ACI_DEV__ usage', () => {
it('expects importing with __ACI_DEV__ true prints a warning', async () => {
expect(__ACI_DEV__).toBeTruthy();
const oldLog = console.error;
console.error = jest.fn();

View File

@ -1,2 +1,2 @@
// @ts-expect-error __DEV__ is declared as const
global.__DEV__ = true;
// @ts-expect-error __ACI_DEV__ is declared as const
global.__ACI_DEV__ = true;