|
| 1 | +/*--------------------------------------------------------------------------------------------- |
| 2 | + * Copyright (c) Microsoft Corporation. All rights reserved. |
| 3 | + *--------------------------------------------------------------------------------------------*/ |
| 4 | + |
| 5 | +import * as assert from 'assert'; |
| 6 | + |
| 7 | +import { isBuildxCacheToInline } from '../spec-node/utils'; |
| 8 | + |
| 9 | +describe('Utils', function () { |
| 10 | + describe('isBuildxCacheToInline', function () { |
| 11 | + it('returns false for undefined or empty', () => { |
| 12 | + assert.strictEqual(isBuildxCacheToInline(undefined), false); |
| 13 | + assert.strictEqual(isBuildxCacheToInline(''), false); |
| 14 | + }); |
| 15 | + |
| 16 | + it('returns true for inline cache type', () => { |
| 17 | + assert.strictEqual(isBuildxCacheToInline('type=inline'), true); |
| 18 | + assert.strictEqual(isBuildxCacheToInline('type = inline'), true); |
| 19 | + assert.strictEqual(isBuildxCacheToInline('type=INLINE'), true); |
| 20 | + assert.strictEqual(isBuildxCacheToInline('mode=max,type=inline,compression=zstd'), true); |
| 21 | + }); |
| 22 | + |
| 23 | + it('returns false for non-inline cache type', () => { |
| 24 | + assert.strictEqual(isBuildxCacheToInline('type=registry'), false); |
| 25 | + assert.strictEqual(isBuildxCacheToInline('type=local'), false); |
| 26 | + assert.strictEqual(isBuildxCacheToInline('inline'), false); |
| 27 | + }); |
| 28 | + }); |
| 29 | +}); |
0 commit comments