Skip to content

Commit

Permalink
style: revert formatter changes
Browse files Browse the repository at this point in the history
  • Loading branch information
nachoaldamav committed Feb 7, 2024
1 parent bf20e15 commit 9336d62
Showing 1 changed file with 27 additions and 27 deletions.
54 changes: 27 additions & 27 deletions builder/policy/policy.spec.ts
Original file line number Diff line number Diff line change
@@ -1,54 +1,54 @@
import path from 'path';
import { createAllowBuildFunction } from './policy';
import path from 'path'
import { createAllowBuildFunction } from './policy'

it('should neverBuiltDependencies', () => {
const allowBuild = createAllowBuildFunction({
neverBuiltDependencies: ['foo'],
});
expect(typeof allowBuild).toBe('function');
})
expect(typeof allowBuild).toBe('function')
if (allowBuild) {
expect(allowBuild('foo')).toBeFalsy();
expect(allowBuild('bar')).toBeTruthy();
expect(allowBuild('foo')).toBeFalsy()
expect(allowBuild('bar')).toBeTruthy()
}
});
})

it('should onlyBuiltDependencies', () => {
const allowBuild = createAllowBuildFunction({
onlyBuiltDependencies: ['foo'],
});
expect(typeof allowBuild).toBe('function');
})
expect(typeof allowBuild).toBe('function')
if (allowBuild) {
expect(allowBuild('foo')).toBeTruthy();
expect(allowBuild('bar')).toBeFalsy();
expect(allowBuild('foo')).toBeTruthy()
expect(allowBuild('bar')).toBeFalsy()
}
});
})

it('should onlyBuiltDependencies set via a file', () => {
const allowBuild = createAllowBuildFunction({
onlyBuiltDependenciesFile: path.join(__dirname, 'onlyBuild.json'),
});
expect(typeof allowBuild).toBe('function');
})
expect(typeof allowBuild).toBe('function')
if (allowBuild) {
expect(allowBuild('zoo')).toBeTruthy();
expect(allowBuild('qar')).toBeTruthy();
expect(allowBuild('bar')).toBeFalsy();
expect(allowBuild('zoo')).toBeTruthy()
expect(allowBuild('qar')).toBeTruthy()
expect(allowBuild('bar')).toBeFalsy()
}
});
})

it('should onlyBuiltDependencies set via a file and config', () => {
const allowBuild = createAllowBuildFunction({
onlyBuiltDependencies: ['bar'],
onlyBuiltDependenciesFile: path.join(__dirname, 'onlyBuild.json'),
});
expect(typeof allowBuild).toBe('function');
})
expect(typeof allowBuild).toBe('function')
if (allowBuild) {
expect(allowBuild('zoo')).toBeTruthy();
expect(allowBuild('qar')).toBeTruthy();
expect(allowBuild('bar')).toBeTruthy();
expect(allowBuild('esbuild')).toBeFalsy();
expect(allowBuild('zoo')).toBeTruthy()
expect(allowBuild('qar')).toBeTruthy()
expect(allowBuild('bar')).toBeTruthy()
expect(allowBuild('esbuild')).toBeFalsy()
}
});
})

it('should return undefined if no policy is set', () => {
expect(createAllowBuildFunction({})).toBeUndefined();
});
expect(createAllowBuildFunction({})).toBeUndefined()
})

0 comments on commit 9336d62

Please sign in to comment.