Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@balena/contrato

Package Overview
Dependencies
Maintainers
3
Versions
100
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@balena/contrato - npm Package Compare versions

Comparing version 0.6.0 to 0.7.0-codewithcheese-update-ava-673e6e27a0b11f46b985a48be6cc73f13fd1131c

4

CHANGELOG.md

@@ -8,2 +8,6 @@ # Change Log

## 0.7.0 - 2021-04-27
* minor: Update ava from 0.22.0 to 3.15.0 [Thomas Manning]
## 0.6.0 - 2020-09-18

@@ -10,0 +14,0 @@

4

package.json
{
"name": "@balena/contrato",
"version": "0.6.0",
"version": "0.7.0-codewithcheese-update-ava-673e6e27a0b11f46b985a48be6cc73f13fd1131c",
"description": "The official contracts implementation",

@@ -32,3 +32,3 @@ "main": "lib/index.js",

"devDependencies": {
"ava": "^0.22.0",
"ava": "^3.15.0",
"eslint": "^4.19.1",

@@ -35,0 +35,0 @@ "eslint-config-standard": "^10.2.1",

@@ -25,3 +25,3 @@ /*

ava.test('should be a contract', (test) => {
ava('should be a contract', (test) => {
const blueprint = new Blueprint({

@@ -34,3 +34,3 @@ 'hw.device-type': 1

ava.test('should set a proper type', (test) => {
ava('should set a proper type', (test) => {
const blueprint = new Blueprint({

@@ -43,3 +43,3 @@ 'hw.device-type': 1

ava.test('should be a hashed contract', (test) => {
ava('should be a hashed contract', (test) => {
const blueprint = new Blueprint({

@@ -52,3 +52,3 @@ 'hw.device-type': 1

ava.test('should parse a layout with one number selector', (test) => {
ava('should parse a layout with one number selector', (test) => {
const blueprint = new Blueprint({

@@ -80,3 +80,3 @@ 'hw.device-type': 1

ava.test('should parse a layout with one finite and one infinite selectors', (test) => {
ava('should parse a layout with one finite and one infinite selectors', (test) => {
const blueprint = new Blueprint({

@@ -118,3 +118,3 @@ 'hw.device-type': 2,

ava.test('should support object layout selectors', (test) => {
ava('should support object layout selectors', (test) => {
const filterFunction = _.identity

@@ -163,3 +163,3 @@

ava.test('should allow passing a skeleton object', (test) => {
ava('should allow passing a skeleton object', (test) => {
const blueprint = new Blueprint({

@@ -166,0 +166,0 @@ 'hw.device-type': 1

@@ -41,3 +41,3 @@ /*

ava.test(testName, (test) => {
ava(testName, (test) => {
const contracts = _.flatMap(testCase.universe, Contract.build)

@@ -56,3 +56,3 @@ const container = new Contract({

ava.test('should consider the skeleton when computing the hashes', (test) => {
ava('should consider the skeleton when computing the hashes', (test) => {
const blueprint = new Blueprint({

@@ -59,0 +59,0 @@ 'hw.device-type': 1

@@ -30,3 +30,3 @@ /*

ava.test(testName, (test) => {
ava(testName, (test) => {
const contracts = _.flatMap(testCase.universe1, Contract.build)

@@ -33,0 +33,0 @@ const container = new Contract({

@@ -315,3 +315,3 @@ /*

], (testCase) => {
ava.test(`should parse ${JSON.stringify(testCase.input)}`, (test) => {
ava(`should parse ${JSON.stringify(testCase.input)}`, (test) => {
test.deepEqual(cardinality.parse(testCase.input), testCase.expected)

@@ -371,7 +371,7 @@ })

], (testCase) => {
ava.test(`should throw "${testCase.error}" given ${JSON.stringify(testCase.input)}`, (test) => {
ava(`should throw "${testCase.error}" given ${JSON.stringify(testCase.input)}`, (test) => {
test.throws(() => {
cardinality.parse(testCase.input)
}, testCase.error)
}, { message: testCase.error })
})
})

@@ -24,3 +24,3 @@ /*

ava.test('should build a tree with one children', (test) => {
ava('should build a tree with one children', (test) => {
const container = new Contract({

@@ -56,3 +56,3 @@ type: 'foo',

ava.test('should build a tree with two contracts of different types', (test) => {
ava('should build a tree with two contracts of different types', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -97,3 +97,3 @@ const contract2 = new Contract(CONTRACTS['sw.blob'].nodejs['4.8.0'].object)

ava.test('should build a tree with two contracts of the same type', (test) => {
ava('should build a tree with two contracts of the same type', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -137,3 +137,3 @@ const contract2 = new Contract(CONTRACTS['sw.os'].fedora['25'].object)

ava.test('should build a tree with two versions of the same slug', (test) => {
ava('should build a tree with two versions of the same slug', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -178,3 +178,3 @@ const contract2 = new Contract(CONTRACTS['sw.os'].debian.jessie.object)

ava.test('should create a tree of two variants of the same contract', (test) => {
ava('should create a tree of two variants of the same contract', (test) => {
const contract1 = new Contract({

@@ -181,0 +181,0 @@ type: 'sw.os',

@@ -24,3 +24,3 @@ /*

ava.test('should add a contract to a contract without children', (test) => {
ava('should add a contract to a contract without children', (test) => {
const container = new Contract({

@@ -62,3 +62,3 @@ type: 'foo',

ava.test('should add two contracts of different types', (test) => {
ava('should add two contracts of different types', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -109,3 +109,3 @@ const contract2 = new Contract(CONTRACTS['sw.blob'].nodejs['4.8.0'].object)

ava.test('should not add a contract twice', (test) => {
ava('should not add a contract twice', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -147,3 +147,3 @@ const container = new Contract({

ava.test('should two contracts of same type but different slugs', (test) => {
ava('should two contracts of same type but different slugs', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -193,3 +193,3 @@ const contract2 = new Contract(CONTRACTS['sw.os'].fedora['25'].object)

ava.test('should add a new version of an existing contract', (test) => {
ava('should add a new version of an existing contract', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -240,3 +240,3 @@ const contract2 = new Contract(CONTRACTS['sw.os'].debian.jessie.object)

ava.test('should add two new versions of an existing contract', (test) => {
ava('should add two new versions of an existing contract', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -299,3 +299,3 @@ const contract2 = new Contract(CONTRACTS['sw.os'].debian.jessie.object)

ava.test('should return the instance', (test) => {
ava('should return the instance', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -310,3 +310,3 @@ const container = new Contract({

ava.test('should re-hash the parent contract', (test) => {
ava('should re-hash the parent contract', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -323,3 +323,3 @@ const container = new Contract({

ava.test('should not re-hash the parent contract if the rehash option is false', (test) => {
ava('should not re-hash the parent contract if the rehash option is false', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -326,0 +326,0 @@ const container = new Contract({

@@ -24,3 +24,3 @@ /*

ava.test('should add a set of one contract', (test) => {
ava('should add a set of one contract', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -62,3 +62,3 @@ const container = new Contract({

ava.test('should ignore duplicates from contract sets', (test) => {
ava('should ignore duplicates from contract sets', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -100,3 +100,3 @@ const container = new Contract({

ava.test('should add a set of multiple contracts to an empty universe', (test) => {
ava('should add a set of multiple contracts to an empty universe', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -143,3 +143,3 @@ const contract2 = new Contract(CONTRACTS['sw.os'].debian.jessie.object)

ava.test('should return the instance', (test) => {
ava('should return the instance', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -155,3 +155,3 @@ const contract2 = new Contract(CONTRACTS['sw.os'].debian.jessie.object)

ava.test('should return the instance if no contracts', (test) => {
ava('should return the instance if no contracts', (test) => {
const container = new Contract({

@@ -165,3 +165,3 @@ type: 'foo',

ava.test('should re-hash the universe', (test) => {
ava('should re-hash the universe', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -180,3 +180,3 @@ const contract2 = new Contract(CONTRACTS['sw.os'].debian.jessie.object)

ava.test('should not re-hash the universe if the rehash option is false', (test) => {
ava('should not re-hash the universe if the rehash option is false', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -198,3 +198,3 @@ const contract2 = new Contract(CONTRACTS['sw.os'].debian.jessie.object)

ava.test('should add a contract of a new slug to an existing type', (test) => {
ava('should add a contract of a new slug to an existing type', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -252,3 +252,3 @@ const contract2 = new Contract(CONTRACTS['sw.os'].debian.jessie.object)

ava.test('should add two contracts of a new slug to an existing type', (test) => {
ava('should add two contracts of a new slug to an existing type', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -255,0 +255,0 @@ const contract2 = new Contract(CONTRACTS['sw.os'].debian.jessie.object)

@@ -22,3 +22,3 @@ /*

ava.test('should return true given a satisfied context', (test) => {
ava('should return true given a satisfied context', (test) => {
const contract = new Contract({

@@ -70,3 +70,3 @@ type: 'foo',

ava.test('should return false given an unsatisfied context', (test) => {
ava('should return false given an unsatisfied context', (test) => {
const contract = new Contract({

@@ -118,3 +118,3 @@ type: 'foo',

ava.test('should return false given a requirement over a contract that does not exist', (test) => {
ava('should return false given a requirement over a contract that does not exist', (test) => {
const contract = new Contract({

@@ -142,3 +142,3 @@ type: 'foo',

ava.test('should return true given a requirement over a contract that does not ' +
ava('should return true given a requirement over a contract that does not ' +
'exist for which the type was not passed', (test) => {

@@ -169,3 +169,3 @@ const contract = new Contract({

ava.test('should return true given one satisfied type in a satisfied context', (test) => {
ava('should return true given one satisfied type in a satisfied context', (test) => {
const contract = new Contract({

@@ -219,3 +219,3 @@ type: 'foo',

ava.test('should return true given one satisfied type in an unsatisfied context', (test) => {
ava('should return true given one satisfied type in an unsatisfied context', (test) => {
const contract = new Contract({

@@ -269,3 +269,3 @@ type: 'foo',

ava.test('should return true given one unknown type in an unsatisfied context', (test) => {
ava('should return true given one unknown type in an unsatisfied context', (test) => {
const contract = new Contract({

@@ -319,3 +319,3 @@ type: 'foo',

ava.test('should return false given one unsatisfied type in an unsatisfied context', (test) => {
ava('should return false given one unsatisfied type in an unsatisfied context', (test) => {
const contract = new Contract({

@@ -369,3 +369,3 @@ type: 'foo',

ava.test('should return false given one unsatisfied and one satisfied type in an unsatisfied context', (test) => {
ava('should return false given one unsatisfied and one satisfied type in an unsatisfied context', (test) => {
const contract = new Contract({

@@ -419,3 +419,3 @@ type: 'foo',

ava.test('should return true given two satisfied types in a satisfied context', (test) => {
ava('should return true given two satisfied types in a satisfied context', (test) => {
const contract = new Contract({

@@ -469,3 +469,3 @@ type: 'foo',

ava.test('should return true given a context with other satisfied contexts', (test) => {
ava('should return true given a context with other satisfied contexts', (test) => {
const container = new Contract({

@@ -525,3 +525,3 @@ type: 'foo',

ava.test('should return false given a context with unsatisfied contexts', (test) => {
ava('should return false given a context with unsatisfied contexts', (test) => {
const container = new Contract({

@@ -528,0 +528,0 @@ type: 'foo',

@@ -22,3 +22,3 @@ /*

ava.test('should build contract templates', (test) => {
ava('should build contract templates', (test) => {
const contracts = Contract.build({

@@ -49,3 +49,3 @@ name: 'Debian {{this.data.codename}}',

ava.test('should support slug and type templates', (test) => {
ava('should support slug and type templates', (test) => {
const contracts = Contract.build({

@@ -76,3 +76,3 @@ name: 'Debian Wheezy',

ava.test('should expand contract variants', (test) => {
ava('should expand contract variants', (test) => {
const contracts = Contract.build({

@@ -113,3 +113,3 @@ slug: 'debian',

ava.test('should build contracts with variants and templates', (test) => {
ava('should build contracts with variants and templates', (test) => {
const contracts = Contract.build({

@@ -154,3 +154,3 @@ name: 'debian {{this.version}}',

ava.test('should expand contract aliases', (test) => {
ava('should expand contract aliases', (test) => {
const contracts = Contract.build({

@@ -184,3 +184,3 @@ slug: 'debian',

ava.test('should build contracts with variants and aliases', (test) => {
ava('should build contracts with variants and aliases', (test) => {
const contracts = Contract.build({

@@ -187,0 +187,0 @@ name: 'debian {{this.version}}',

@@ -24,3 +24,3 @@ /*

ava.test('should have an empty cache by default', (test) => {
ava('should have an empty cache by default', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -38,3 +38,3 @@ const contract2 = new Contract(CONTRACTS['sw.os'].debian.jessie.object)

ava.test('should create an entry after a successful search', (test) => {
ava('should create an entry after a successful search', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -63,3 +63,3 @@ const contract2 = new Contract(CONTRACTS['sw.os'].fedora['25'].object)

ava.test('should be able to store multiple entries', (test) => {
ava('should be able to store multiple entries', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -95,3 +95,3 @@ const contract2 = new Contract(CONTRACTS['sw.os'].fedora['25'].object)

ava.test('should still store an entry if there were no results', (test) => {
ava('should still store an entry if there were no results', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -120,3 +120,3 @@ const contract2 = new Contract(CONTRACTS['sw.os'].fedora['25'].object)

ava.test('should honor a matcher over and over again', (test) => {
ava('should honor a matcher over and over again', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -143,3 +143,3 @@ const contract2 = new Contract(CONTRACTS['sw.os'].fedora['25'].object)

ava.test('should clear the cache for a certain type if a contract is added', (test) => {
ava('should clear the cache for a certain type if a contract is added', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -178,3 +178,3 @@ const contract2 = new Contract(CONTRACTS['sw.os'].fedora['25'].object)

ava.test('should clear the cache for a certain type if a contract is removed', (test) => {
ava('should clear the cache for a certain type if a contract is removed', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -213,3 +213,3 @@ const contract2 = new Contract(CONTRACTS['sw.os'].fedora['25'].object)

ava.test('should clear the cache for a certain type if the removed contract did not exist', (test) => {
ava('should clear the cache for a certain type if the removed contract did not exist', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -216,0 +216,0 @@ const contract2 = new Contract(CONTRACTS['sw.os'].fedora['25'].object)

@@ -23,3 +23,3 @@ /*

ava.test('should take a contract with a single child', (test) => {
ava('should take a contract with a single child', (test) => {
const contract = new Contract({

@@ -77,3 +77,3 @@ type: 'misc.collection',

ava.test('should take a contract with two children of the same type', (test) => {
ava('should take a contract with two children of the same type', (test) => {
const contract = new Contract({

@@ -154,3 +154,3 @@ type: 'misc.collection',

ava.test('should take a contract with two children of the same type and slug', (test) => {
ava('should take a contract with two children of the same type and slug', (test) => {
const contract = new Contract({

@@ -243,3 +243,3 @@ type: 'misc.collection',

ava.test('should take a contract with two children of different types', (test) => {
ava('should take a contract with two children of different types', (test) => {
const contract = new Contract({

@@ -246,0 +246,0 @@ type: 'misc.collection',

@@ -24,3 +24,3 @@ /*

ava.test('should create a simple contract', (test) => {
ava('should create a simple contract', (test) => {
const contract = new Contract({

@@ -27,0 +27,0 @@ type: 'arch.sw',

@@ -23,3 +23,3 @@ /*

ava.test('should hash the contract by default', (test) => {
ava('should hash the contract by default', (test) => {
const contract = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -29,3 +29,3 @@ test.is(typeof contract.metadata.hash, 'string')

ava.test('should not hash the contract if hash is set to false', (test) => {
ava('should not hash the contract if hash is set to false', (test) => {
const contract = new Contract(CONTRACTS['sw.os'].debian.wheezy.object, {

@@ -32,0 +32,0 @@ hash: false

@@ -35,3 +35,3 @@ /*

ava.test('should create a simple contract with empty requirements', (test) => {
ava('should create a simple contract with empty requirements', (test) => {
const contract = new Contract({

@@ -58,3 +58,3 @@ type: 'arch.sw',

ava.test('should create a contract with a single top level requirement', (test) => {
ava('should create a contract with a single top level requirement', (test) => {
const contract = new Contract({

@@ -103,3 +103,3 @@ type: 'arch.sw',

ava.test('should ignore duplicate top level requirements matchers', (test) => {
ava('should ignore duplicate top level requirements matchers', (test) => {
const contract = new Contract({

@@ -160,3 +160,3 @@ type: 'arch.sw',

ava.test('should create a contract with two top level requirements', (test) => {
ava('should create a contract with two top level requirements', (test) => {
const contract = new Contract({

@@ -223,3 +223,3 @@ type: 'sw.os',

ava.test('should create a contract with a single or requirement', (test) => {
ava('should create a contract with a single or requirement', (test) => {
const contract = new Contract({

@@ -296,3 +296,3 @@ type: 'arch.sw',

ava.test('should ignore duplicate matchers from or requirements', (test) => {
ava('should ignore duplicate matchers from or requirements', (test) => {
const contract = new Contract({

@@ -299,0 +299,0 @@ type: 'arch.sw',

@@ -22,3 +22,3 @@ /*

ava.test('should resolve templates for which the values exist', (test) => {
ava('should resolve templates for which the values exist', (test) => {
const contract = new Contract({

@@ -41,3 +41,3 @@ type: 'arch.sw',

ava.test('should not resolve templates for which the values do not exist', (test) => {
ava('should not resolve templates for which the values do not exist', (test) => {
const contract = new Contract({

@@ -58,3 +58,3 @@ type: 'arch.sw',

ava.test('should not hash a templated contract if the hash option is false', (test) => {
ava('should not hash a templated contract if the hash option is false', (test) => {
const contract = new Contract({

@@ -61,0 +61,0 @@ type: 'arch.sw',

@@ -22,3 +22,3 @@ /*

ava.test('should create contract instance', (test) => {
ava('should create contract instance', (test) => {
const matcher = Contract.createMatcher({

@@ -32,3 +32,3 @@ type: 'arch.sw',

ava.test('should include the properties in data', (test) => {
ava('should include the properties in data', (test) => {
const matcher = Contract.createMatcher({

@@ -45,3 +45,3 @@ type: 'arch.sw',

ava.test('should set the type appropriately', (test) => {
ava('should set the type appropriately', (test) => {
const matcher = Contract.createMatcher({

@@ -55,3 +55,3 @@ type: 'arch.sw',

ava.test('should be able to set the operation name', (test) => {
ava('should be able to set the operation name', (test) => {
const matcher = Contract.createMatcher({

@@ -58,0 +58,0 @@ type: 'arch.sw',

@@ -23,3 +23,3 @@ /*

ava.test('should find nothing given no properties', (test) => {
ava('should find nothing given no properties', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -36,3 +36,3 @@ const container = new Contract({

ava.test('should find a specific unique contract based on its type and name', (test) => {
ava('should find a specific unique contract based on its type and name', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -55,3 +55,3 @@ const contract2 = new Contract(CONTRACTS['sw.os'].fedora['25'].object)

ava.test('should find a specific unique contract based on its type and slug', (test) => {
ava('should find a specific unique contract based on its type and slug', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -76,3 +76,3 @@ const contract2 = new Contract(CONTRACTS['sw.os'].debian.jessie.object)

ava.test('should find a specific unique contract based on another property', (test) => {
ava('should find a specific unique contract based on another property', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -97,3 +97,3 @@ const contract2 = new Contract(CONTRACTS['sw.os'].debian.jessie.object)

ava.test('should find multiple contracts based on a type', (test) => {
ava('should find multiple contracts based on a type', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -119,3 +119,3 @@ const contract2 = new Contract(CONTRACTS['sw.os'].debian.jessie.object)

ava.test('should find nothing based on a non-existent type', (test) => {
ava('should find nothing based on a non-existent type', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -137,3 +137,3 @@ const contract2 = new Contract(CONTRACTS['sw.os'].debian.jessie.object)

ava.test('should find nothing because of an invalid type', (test) => {
ava('should find nothing because of an invalid type', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -156,3 +156,3 @@ const contract2 = new Contract(CONTRACTS['sw.os'].debian.jessie.object)

ava.test('should find a contract based on one of its aliases', (test) => {
ava('should find a contract based on one of its aliases', (test) => {
const contract1 = new Contract({

@@ -185,3 +185,3 @@ type: 'hw.device-type',

ava.test('should find a nested contract by its type and slug', (test) => {
ava('should find a nested contract by its type and slug', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -208,3 +208,3 @@ const contract2 = new Contract(CONTRACTS['sw.os'].debian.jessie.object)

ava.test('should find a nested contract by its type and another property', (test) => {
ava('should find a nested contract by its type and another property', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -231,3 +231,3 @@ const contract2 = new Contract(CONTRACTS['sw.os'].debian.jessie.object)

ava.test('should fail to find a nested contract with an incorrect slug', (test) => {
ava('should fail to find a nested contract with an incorrect slug', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -252,3 +252,3 @@ const contract2 = new Contract(CONTRACTS['sw.os'].debian.jessie.object)

ava.test('should fail to find a nested contract with an incorrect type', (test) => {
ava('should fail to find a nested contract with an incorrect type', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -273,3 +273,3 @@ const contract2 = new Contract(CONTRACTS['sw.os'].debian.jessie.object)

ava.test('should be able to find a two level nested children using its type', (test) => {
ava('should be able to find a two level nested children using its type', (test) => {
const contract1 = new Contract(CONTRACTS['hw.device-type'].artik10.object)

@@ -276,0 +276,0 @@ const contract2 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -22,3 +22,3 @@ /*

ava.test('should return only the slug given a contract without aliases', (test) => {
ava('should return only the slug given a contract without aliases', (test) => {
const contract = new Contract({

@@ -33,3 +33,3 @@ type: 'arch.sw',

ava.test('should include the aliases if present', (test) => {
ava('should include the aliases if present', (test) => {
const contract = new Contract({

@@ -49,3 +49,3 @@ type: 'hw.device-type',

ava.test('should return only the slug if aliases is empty', (test) => {
ava('should return only the slug if aliases is empty', (test) => {
const contract = new Contract({

@@ -52,0 +52,0 @@ type: 'arch.sw',

@@ -22,3 +22,3 @@ /*

ava.test('should return the canonical slug', (test) => {
ava('should return the canonical slug', (test) => {
const contract = new Contract({

@@ -34,3 +34,3 @@ type: 'arch.sw',

ava.test('should return the slug if canonical slug does not exist', (test) => {
ava('should return the slug if canonical slug does not exist', (test) => {
const contract = new Contract({

@@ -37,0 +37,0 @@ type: 'arch.sw',

@@ -23,3 +23,3 @@ /*

ava.test('should return an existing child given its hash', (test) => {
ava('should return an existing child given its hash', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -40,3 +40,3 @@ const contract2 = new Contract(CONTRACTS['sw.os'].debian.jessie.object)

ava.test('should return nothing if the hash does not exist', (test) => {
ava('should return nothing if the hash does not exist', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -43,0 +43,0 @@ const contract2 = new Contract(CONTRACTS['sw.os'].debian.jessie.object)

@@ -23,3 +23,3 @@ /*

ava.test('should return all contracts of the type if the type exists', (test) => {
ava('should return all contracts of the type if the type exists', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -44,3 +44,3 @@ const contract2 = new Contract(CONTRACTS['sw.os'].debian.jessie.object)

ava.test('should always return the same results', (test) => {
ava('should always return the same results', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -77,3 +77,3 @@ const contract2 = new Contract(CONTRACTS['sw.os'].debian.jessie.object)

ava.test('should return nothing if the type does not exist', (test) => {
ava('should return nothing if the type does not exist', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -94,3 +94,3 @@ const contract2 = new Contract(CONTRACTS['sw.os'].debian.jessie.object)

ava.test('should not return the same contract multiple times if it contains aliases', (test) => {
ava('should not return the same contract multiple times if it contains aliases', (test) => {
const contract1 = new Contract(CONTRACTS['sw.blob'].nodejs['4.8.0'].object)

@@ -97,0 +97,0 @@ const contract2 = new Contract({

@@ -23,3 +23,3 @@ /*

ava.test('should throw if the type is not valid', (test) => {
ava('should throw if the type is not valid', (test) => {
const container = new Contract({

@@ -41,6 +41,6 @@ type: 'foo',

})
}, 'Invalid cardinality: 2 to 2. The number of foo contracts in the universe is 0')
}, { message: 'Invalid cardinality: 2 to 2. The number of foo contracts in the universe is 0' })
})
ava.test('should return combinations of cardinality 1 for one contract', (test) => {
ava('should return combinations of cardinality 1 for one contract', (test) => {
const container = new Contract({

@@ -67,3 +67,3 @@ type: 'foo',

ava.test('should return combinations of cardinality 1 for two contracts', (test) => {
ava('should return combinations of cardinality 1 for two contracts', (test) => {
const container = new Contract({

@@ -94,3 +94,3 @@ type: 'foo',

ava.test('should return combinations of cardinality 1 for three contracts', (test) => {
ava('should return combinations of cardinality 1 for three contracts', (test) => {
const container = new Contract({

@@ -125,3 +125,3 @@ type: 'foo',

ava.test('should return combinations of cardinality 2 for two contracts', (test) => {
ava('should return combinations of cardinality 2 for two contracts', (test) => {
const container = new Contract({

@@ -150,3 +150,3 @@ type: 'foo',

ava.test('should return combinations of cardinality 2 for three contracts', (test) => {
ava('should return combinations of cardinality 2 for three contracts', (test) => {
const container = new Contract({

@@ -184,3 +184,3 @@ type: 'foo',

ava.test('should throw if "from" is greater than "to"', (test) => {
ava('should throw if "from" is greater than "to"', (test) => {
const container = new Contract({

@@ -202,6 +202,6 @@ type: 'foo',

})
}, 'Invalid cardinality: 2 to 1. The starting point is greater than the ending point')
}, { message: 'Invalid cardinality: 2 to 1. The starting point is greater than the ending point' })
})
ava.test('should generate combinations from 1 to 2 for one contract', (test) => {
ava('should generate combinations from 1 to 2 for one contract', (test) => {
const container = new Contract({

@@ -228,3 +228,3 @@ type: 'foo',

ava.test('should return combinations from 1 to 2 for two contracts', (test) => {
ava('should return combinations from 1 to 2 for two contracts', (test) => {
const container = new Contract({

@@ -259,3 +259,3 @@ type: 'foo',

ava.test('should return combinations from 1 to 3 for two contracts', (test) => {
ava('should return combinations from 1 to 3 for two contracts', (test) => {
const container = new Contract({

@@ -290,3 +290,3 @@ type: 'foo',

ava.test('should return combinations from 1 to 3 for three contracts', (test) => {
ava('should return combinations from 1 to 3 for three contracts', (test) => {
const container = new Contract({

@@ -337,3 +337,3 @@ type: 'foo',

ava.test('should not consider aliases as separate contracts', (test) => {
ava('should not consider aliases as separate contracts', (test) => {
const contract1 = new Contract({

@@ -340,0 +340,0 @@ type: 'hw.device-type',

@@ -22,3 +22,3 @@ /*

ava.test('should compute the intersection of one type and two contracts with or operators', (test) => {
ava('should compute the intersection of one type and two contracts with or operators', (test) => {
const contract = new Contract({

@@ -101,3 +101,3 @@ type: 'foo',

ava.test('should return nothing if the from contract does not contain the referenced contracts', (test) => {
ava('should return nothing if the from contract does not contain the referenced contracts', (test) => {
const contract = new Contract({

@@ -159,3 +159,3 @@ type: 'foo',

ava.test('should compute the intersection of more than one type, from more than two contracts', (test) => {
ava('should compute the intersection of more than one type, from more than two contracts', (test) => {
const contract = new Contract({

@@ -301,3 +301,3 @@ type: 'foo',

ava.test('should return nothing if there is no intersection', (test) => {
ava('should return nothing if there is no intersection', (test) => {
const contract = new Contract({

@@ -366,3 +366,3 @@ type: 'foo',

ava.test('should not discard contracts of a type not defined in another contracts', (test) => {
ava('should not discard contracts of a type not defined in another contracts', (test) => {
const contract = new Contract({

@@ -369,0 +369,0 @@ type: 'foo',

@@ -23,3 +23,3 @@ /*

ava.test('should return an empty set if no children', (test) => {
ava('should return an empty set if no children', (test) => {
const container = new Contract({

@@ -33,3 +33,3 @@ type: 'foo',

ava.test('should return one type given one child', (test) => {
ava('should return one type given one child', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -46,3 +46,3 @@ const container = new Contract({

ava.test('should ignore duplicate types', (test) => {
ava('should ignore duplicate types', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -59,3 +59,3 @@ const contract2 = new Contract(CONTRACTS['sw.os'].debian.jessie.object)

ava.test('should return all children types', (test) => {
ava('should return all children types', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -72,3 +72,3 @@ const contract2 = new Contract(CONTRACTS['sw.blob'].nodejs['4.8.0'].object)

ava.test('should update the types when adding a contract', (test) => {
ava('should update the types when adding a contract', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -86,3 +86,3 @@ const contract2 = new Contract(CONTRACTS['sw.blob'].nodejs['4.8.0'].object)

ava.test('should consider nested children', (test) => {
ava('should consider nested children', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -101,3 +101,3 @@ const contract2 = new Contract(CONTRACTS['sw.blob'].nodejs['4.8.0'].object)

ava.test('should consider two level nested children', (test) => {
ava('should consider two level nested children', (test) => {
const contract1 = new Contract(CONTRACTS['hw.device-type'].artik10.object)

@@ -104,0 +104,0 @@ const contract2 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -23,3 +23,3 @@ /*

ava.test('should get nothing if no children', (test) => {
ava('should get nothing if no children', (test) => {
const container = new Contract({

@@ -33,3 +33,3 @@ type: 'foo',

ava.test('should get the paths of a one child container', (test) => {
ava('should get the paths of a one child container', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -48,3 +48,3 @@ const container = new Contract({

ava.test('should get the paths of two contracts with different slugs', (test) => {
ava('should get the paths of two contracts with different slugs', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -65,3 +65,3 @@ const contract2 = new Contract(CONTRACTS['sw.os'].fedora['25'].object)

ava.test('should get the paths of two contracts with same slugs', (test) => {
ava('should get the paths of two contracts with same slugs', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -82,3 +82,3 @@ const contract2 = new Contract(CONTRACTS['sw.os'].debian.jessie.object)

ava.test('should be able to filter by one type', (test) => {
ava('should be able to filter by one type', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -100,3 +100,3 @@ const contract2 = new Contract(CONTRACTS['sw.blob'].nodejs['4.8.0'].object)

ava.test('should be able to filter by two types', (test) => {
ava('should be able to filter by two types', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -120,3 +120,3 @@ const contract2 = new Contract(CONTRACTS['sw.blob'].nodejs['4.8.0'].object)

ava.test('should ignore unknown types', (test) => {
ava('should ignore unknown types', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -138,3 +138,3 @@ const contract2 = new Contract(CONTRACTS['sw.blob'].nodejs['4.8.0'].object)

ava.test('should return an empty array if no type matches', (test) => {
ava('should return an empty array if no type matches', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -154,3 +154,3 @@ const contract2 = new Contract(CONTRACTS['sw.blob'].nodejs['4.8.0'].object)

ava.test('should not return the same contract multiple times if it contains aliases', (test) => {
ava('should not return the same contract multiple times if it contains aliases', (test) => {
const contract1 = new Contract(CONTRACTS['sw.blob'].nodejs['4.8.0'].object)

@@ -177,3 +177,3 @@ const contract2 = new Contract({

ava.test('should return nested children', (test) => {
ava('should return nested children', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -196,3 +196,3 @@ const contract2 = new Contract(CONTRACTS['sw.blob'].nodejs['4.8.0'].object)

ava.test('should return two level nested children', (test) => {
ava('should return two level nested children', (test) => {
const contract1 = new Contract(CONTRACTS['hw.device-type'].artik10.object)

@@ -218,3 +218,3 @@ const contract2 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

ava.test('should return nested children that match the desired type', (test) => {
ava('should return nested children that match the desired type', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -221,0 +221,0 @@ const contract2 = new Contract(CONTRACTS['sw.blob'].nodejs['4.8.0'].object)

@@ -22,3 +22,3 @@ /*

ava.test('should return the reference string of a contract without a version', (test) => {
ava('should return the reference string of a contract without a version', (test) => {
const contract = new Contract({

@@ -33,3 +33,3 @@ type: 'sw.arch',

ava.test('should return the reference string of a contract with a version', (test) => {
ava('should return the reference string of a contract with a version', (test) => {
const contract = new Contract({

@@ -36,0 +36,0 @@ type: 'sw.os',

@@ -22,3 +22,3 @@ /*

ava.test('should return the slug', (test) => {
ava('should return the slug', (test) => {
const contract = new Contract({

@@ -25,0 +25,0 @@ type: 'arch.sw',

@@ -22,3 +22,3 @@ /*

ava.test('should return the type', (test) => {
ava('should return the type', (test) => {
const contract = new Contract({

@@ -25,0 +25,0 @@ type: 'arch.sw',

@@ -22,3 +22,3 @@ /*

ava.test('should return the version if there is one', (test) => {
ava('should return the version if there is one', (test) => {
const contract = new Contract({

@@ -34,3 +34,3 @@ type: 'sw.os',

ava.test('should return undefined if there is not one', (test) => {
ava('should return undefined if there is not one', (test) => {
const contract = new Contract({

@@ -37,0 +37,0 @@ type: 'sw.os',

@@ -22,3 +22,3 @@ /*

ava.test('should return false given a contract without aliases', (test) => {
ava('should return false given a contract without aliases', (test) => {
const contract = new Contract({

@@ -33,3 +33,3 @@ type: 'arch.sw',

ava.test('should return true given a contract with aliases', (test) => {
ava('should return true given a contract with aliases', (test) => {
const contract = new Contract({

@@ -45,3 +45,3 @@ type: 'hw.device-type',

ava.test('should return false given a contract with empty aliases', (test) => {
ava('should return false given a contract with empty aliases', (test) => {
const contract = new Contract({

@@ -48,0 +48,0 @@ type: 'arch.sw',

@@ -22,3 +22,3 @@ /*

ava.test('should be able to re-hash a mutated contract', (test) => {
ava('should be able to re-hash a mutated contract', (test) => {
const contract = new Contract({

@@ -36,3 +36,3 @@ type: 'arch.sw',

ava.test('should not re-hash metadata changes', (test) => {
ava('should not re-hash metadata changes', (test) => {
const contract = new Contract({

@@ -39,0 +39,0 @@ type: 'arch.sw',

@@ -22,3 +22,3 @@ /*

ava.test('should build missing templates', (test) => {
ava('should build missing templates', (test) => {
const contract = new Contract({

@@ -49,3 +49,3 @@ name: 'Debian {{this.data.codename}}',

ava.test('should not rehash the contract if the rehash option is set to false', (test) => {
ava('should not rehash the contract if the rehash option is set to false', (test) => {
const contract = new Contract({

@@ -82,3 +82,3 @@ name: 'Debian {{this.data.codename}}',

ava.test('should return the contract instance', (test) => {
ava('should return the contract instance', (test) => {
const contract = new Contract({

@@ -97,3 +97,3 @@ name: 'Debian {{this.data.codename}}',

ava.test('should not perform interpolation on children', (test) => {
ava('should not perform interpolation on children', (test) => {
const contract = new Contract({

@@ -100,0 +100,0 @@ slug: 'debian',

@@ -22,3 +22,3 @@ /*

ava.test('should return true if the contracts are equal', (test) => {
ava('should return true if the contracts are equal', (test) => {
const contract1 = new Contract({

@@ -39,3 +39,3 @@ type: 'arch.sw',

ava.test('should return false if the contracts are different', (test) => {
ava('should return false if the contracts are different', (test) => {
const contract1 = new Contract({

@@ -56,3 +56,3 @@ type: 'arch.sw',

ava.test('should return false if the contracts are different but have not been hashed', (test) => {
ava('should return false if the contracts are different but have not been hashed', (test) => {
const contract1 = new Contract({

@@ -77,3 +77,3 @@ type: 'arch.sw',

ava.test('should return true if the contracts are equal but have not been hashed', (test) => {
ava('should return true if the contracts are equal but have not been hashed', (test) => {
const contract1 = new Contract({

@@ -80,0 +80,0 @@ type: 'arch.sw',

@@ -28,3 +28,3 @@ /*

ava.test('should delete a contract from a set of contracts', (test) => {
ava('should delete a contract from a set of contracts', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -43,3 +43,3 @@ const contract2 = new Contract(CONTRACTS['sw.os'].debian.jessie.object)

ava.test('should ignore contracts that are not in the set', (test) => {
ava('should ignore contracts that are not in the set', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -58,3 +58,3 @@ const contract2 = new Contract(CONTRACTS['sw.os'].debian.jessie.object)

ava.test('should remove a slug object if it becomes empty after the removal', (test) => {
ava('should remove a slug object if it becomes empty after the removal', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -72,3 +72,3 @@ const contract2 = new Contract(CONTRACTS['sw.os'].fedora['25'].object)

ava.test('should correctly handle number versions', (test) => {
ava('should correctly handle number versions', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -87,3 +87,3 @@ const contract2 = new Contract(CONTRACTS['sw.os'].fedora['24'].object)

ava.test('should ignore an invalid version of an existing contract', (test) => {
ava('should ignore an invalid version of an existing contract', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -102,3 +102,3 @@ const contract2 = new Contract(CONTRACTS['sw.os'].debian.jessie.object)

ava.test('should take versions into account before removing a contract from the slug object', (test) => {
ava('should take versions into account before removing a contract from the slug object', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -117,3 +117,3 @@ const contract2 = new Contract(CONTRACTS['sw.os'].fedora['24'].object)

ava.test('should take versions into account before removing a contract from the type object', (test) => {
ava('should take versions into account before removing a contract from the type object', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -131,3 +131,3 @@ const contract2 = new Contract(CONTRACTS['sw.os'].debian.jessie.object)

ava.test('should remove a type object if it becomes empty after the removal', (test) => {
ava('should remove a type object if it becomes empty after the removal', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -145,3 +145,3 @@ const contract2 = new Contract(CONTRACTS['sw.blob'].nodejs['4.8.0'].object)

ava.test('should return the object instance', (test) => {
ava('should return the object instance', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -156,3 +156,3 @@ const contract2 = new Contract(CONTRACTS['sw.os'].debian.jessie.object)

ava.test('should return the object instance even if the type does not exist', (test) => {
ava('should return the object instance even if the type does not exist', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -167,3 +167,3 @@ const contract2 = new Contract(CONTRACTS['sw.os'].debian.jessie.object)

ava.test('should remove a contract with aliases', (test) => {
ava('should remove a contract with aliases', (test) => {
const contract1 = new Contract(CONTRACTS['sw.blob'].nodejs['4.8.0'].object)

@@ -186,3 +186,3 @@ const contract2 = new Contract({

ava.test('should remove a contract with aliases when there is another aliased contract of the same type', (test) => {
ava('should remove a contract with aliases when there is another aliased contract of the same type', (test) => {
const contract1 = new Contract({

@@ -211,3 +211,3 @@ type: 'hw.device-type',

ava.test('should remove a contract with aliases when there are two aliased contracts of the same type', (test) => {
ava('should remove a contract with aliases when there are two aliased contracts of the same type', (test) => {
const contract1 = new Contract({

@@ -243,3 +243,3 @@ type: 'hw.device-type',

ava.test('should re-hash the universe', (test) => {
ava('should re-hash the universe', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -258,3 +258,3 @@ const contract2 = new Contract(CONTRACTS['sw.os'].debian.jessie.object)

ava.test('should not re-hash the universe if the rehash option is false', (test) => {
ava('should not re-hash the universe if the rehash option is false', (test) => {
const contract1 = new Contract(CONTRACTS['sw.os'].debian.wheezy.object)

@@ -261,0 +261,0 @@ const contract2 = new Contract(CONTRACTS['sw.os'].debian.jessie.object)

@@ -23,3 +23,3 @@ /*

ava.test('should return true given an empty contract and a contract without requirements', (test) => {
ava('should return true given an empty contract and a contract without requirements', (test) => {
const contract = new Contract({

@@ -38,3 +38,3 @@ type: 'foo',

ava.test('should return false given an empty contract and a contract with requirements', (test) => {
ava('should return false given an empty contract and a contract with requirements', (test) => {
const contract = new Contract({

@@ -59,3 +59,3 @@ type: 'foo',

ava.test('should return true given a contract without requirements', (test) => {
ava('should return true given a contract without requirements', (test) => {
const contract = new Contract({

@@ -79,3 +79,3 @@ type: 'foo',

ava.test('should return true given one fulfilled requirement', (test) => {
ava('should return true given one fulfilled requirement', (test) => {
const contract = new Contract({

@@ -105,3 +105,3 @@ type: 'foo',

ava.test('should return true given two fulfilled requirements', (test) => {
ava('should return true given two fulfilled requirements', (test) => {
const contract = new Contract({

@@ -136,3 +136,3 @@ type: 'foo',

ava.test('should return false given one unfulfilled requirement', (test) => {
ava('should return false given one unfulfilled requirement', (test) => {
const contract = new Contract({

@@ -162,3 +162,3 @@ type: 'foo',

ava.test('should return false given two requirements where one is not fulfilled', (test) => {
ava('should return false given two requirements where one is not fulfilled', (test) => {
const contract = new Contract({

@@ -192,3 +192,3 @@ type: 'foo',

ava.test('should return true given no requirements in a disjunction', (test) => {
ava('should return true given no requirements in a disjunction', (test) => {
const contract = new Contract({

@@ -217,3 +217,3 @@ type: 'foo',

ava.test('should return false given a partially unfulfilled not operator', (test) => {
ava('should return false given a partially unfulfilled not operator', (test) => {
const contract = new Contract({

@@ -249,3 +249,3 @@ type: 'foo',

ava.test('should return false given an unfulfilled not operator', (test) => {
ava('should return false given an unfulfilled not operator', (test) => {
const contract = new Contract({

@@ -277,3 +277,3 @@ type: 'foo',

ava.test('should return false given a fulfilled not operator', (test) => {
ava('should return false given a fulfilled not operator', (test) => {
const contract = new Contract({

@@ -305,3 +305,3 @@ type: 'foo',

ava.test('should return true given an empty not operator', (test) => {
ava('should return true given an empty not operator', (test) => {
const contract = new Contract({

@@ -328,3 +328,3 @@ type: 'foo',

ava.test('should return false given two unfulfilled requirements', (test) => {
ava('should return false given two unfulfilled requirements', (test) => {
const contract = new Contract({

@@ -358,3 +358,3 @@ type: 'foo',

ava.test('should return true given one fulfilled requirement in a disjunction', (test) => {
ava('should return true given one fulfilled requirement in a disjunction', (test) => {
const contract = new Contract({

@@ -388,3 +388,3 @@ type: 'foo',

ava.test('should return true given one fulfilled and one unfulfilled requirement in a disjunction', (test) => {
ava('should return true given one fulfilled and one unfulfilled requirement in a disjunction', (test) => {
const contract = new Contract({

@@ -422,3 +422,3 @@ type: 'foo',

ava.test('should return false given one unfulfilled requirement in a disjunction', (test) => {
ava('should return false given one unfulfilled requirement in a disjunction', (test) => {
const contract = new Contract({

@@ -452,3 +452,3 @@ type: 'foo',

ava.test('should return false given an empty disjunction and an unfulfilled requirement', (test) => {
ava('should return false given an empty disjunction and an unfulfilled requirement', (test) => {
const contract = new Contract({

@@ -481,3 +481,3 @@ type: 'foo',

ava.test('should return false given an fulfilled disjunction and an unfulfilled requirement', (test) => {
ava('should return false given an fulfilled disjunction and an unfulfilled requirement', (test) => {
const contract = new Contract({

@@ -519,3 +519,3 @@ type: 'foo',

ava.test('should be able to specify a single type', (test) => {
ava('should be able to specify a single type', (test) => {
const contract = new Contract({

@@ -551,3 +551,3 @@ type: 'foo',

ava.test('should be able to specify multiple types', (test) => {
ava('should be able to specify multiple types', (test) => {
const contract = new Contract({

@@ -595,3 +595,3 @@ type: 'foo',

ava.test('should return false given one unfulfilled requirement selected type', (test) => {
ava('should return false given one unfulfilled requirement selected type', (test) => {
const contract = new Contract({

@@ -623,3 +623,3 @@ type: 'foo',

ava.test('should return true given one unfulfilled requirement in a disjunction of a non-selected type', (test) => {
ava('should return true given one unfulfilled requirement in a disjunction of a non-selected type', (test) => {
const contract = new Contract({

@@ -657,3 +657,3 @@ type: 'foo',

ava.test('should return true given two fulfilled requirements from a context with a composite contract', (test) => {
ava('should return true given two fulfilled requirements from a context with a composite contract', (test) => {
const container = new Contract({

@@ -709,3 +709,3 @@ type: 'foo',

ava.test('should return false given one unfulfilled requirement from a context with a composite contract', (test) => {
ava('should return false given one unfulfilled requirement from a context with a composite contract', (test) => {
const container = new Contract({

@@ -761,3 +761,3 @@ type: 'foo',

ava.test('should return true given one ignored unfulfilled requirement ' +
ava('should return true given one ignored unfulfilled requirement ' +
'on a context with a composite contract', (test) => {

@@ -816,3 +816,3 @@ const container = new Contract({

ava.test('should return true given a fulfilled context as an argument', (test) => {
ava('should return true given a fulfilled context as an argument', (test) => {
const container = new Contract({

@@ -852,3 +852,3 @@ type: 'foo',

ava.test('should return false given a unfulfilled context as an argument', (test) => {
ava('should return false given a unfulfilled context as an argument', (test) => {
const container = new Contract({

@@ -855,0 +855,0 @@ type: 'foo',

@@ -23,3 +23,3 @@ /*

ava.test('should convert a contract into a JSON object', (test) => {
ava('should convert a contract into a JSON object', (test) => {
const source = CONTRACTS['sw.os'].debian.wheezy.object

@@ -30,3 +30,3 @@ const contract = new Contract(source)

ava.test('should handle a contract with one child', (test) => {
ava('should handle a contract with one child', (test) => {
const container = new Contract({

@@ -50,3 +50,3 @@ type: 'foo',

ava.test('should handle a contract with two children of the same type and slug', (test) => {
ava('should handle a contract with two children of the same type and slug', (test) => {
const container = new Contract({

@@ -78,3 +78,3 @@ type: 'foo',

ava.test('should handle a contract with two children of the same type but different slugs', (test) => {
ava('should handle a contract with two children of the same type but different slugs', (test) => {
const container = new Contract({

@@ -104,3 +104,3 @@ type: 'foo',

ava.test('should handle a contract with two children of different types', (test) => {
ava('should handle a contract with two children of different types', (test) => {
const container = new Contract({

@@ -128,3 +128,3 @@ type: 'foo',

ava.test('should not expand one child with aliases', (test) => {
ava('should not expand one child with aliases', (test) => {
const contract1 = new Contract({

@@ -157,3 +157,3 @@ type: 'hw.device-type',

ava.test('should expand aliases in two children of the same type', (test) => {
ava('should expand aliases in two children of the same type', (test) => {
const contract1 = new Contract({

@@ -199,3 +199,3 @@ type: 'hw.device-type',

ava.test('should correctly handle one aliased and one non aliased child of the same type', (test) => {
ava('should correctly handle one aliased and one non aliased child of the same type', (test) => {
const contract1 = new Contract({

@@ -239,3 +239,3 @@ type: 'hw.device-type',

ava.test('should correctly handle one none aliased and one aliased child of the same type', (test) => {
ava('should correctly handle one none aliased and one aliased child of the same type', (test) => {
const contract1 = new Contract({

@@ -242,0 +242,0 @@ type: 'hw.device-type',

@@ -23,3 +23,3 @@ /*

ava.test('should return a string', (test) => {
ava('should return a string', (test) => {
test.true(_.isString(hash.hashObject({

@@ -30,3 +30,3 @@ foo: 'bar'

ava.test('should not care about properties order', (test) => {
ava('should not care about properties order', (test) => {
const hash1 = hash.hashObject({

@@ -45,3 +45,3 @@ foo: 'bar',

ava.test('should not rely on object references', (test) => {
ava('should not rely on object references', (test) => {
const object = {

@@ -60,3 +60,3 @@ foo: 'bar'

ava.test('should return different hashes for different objects', (test) => {
ava('should return different hashes for different objects', (test) => {
const hash1 = hash.hashObject({

@@ -63,0 +63,0 @@ foo: 'bar'

@@ -23,3 +23,3 @@ /*

ava.test('should add one value to the cache', (test) => {
ava('should add one value to the cache', (test) => {
const cache = new MatcherCache()

@@ -44,3 +44,3 @@

ava.test('should add two values to the cache using the same type', (test) => {
ava('should add two values to the cache using the same type', (test) => {
const cache = new MatcherCache()

@@ -75,3 +75,3 @@

ava.test('should add two values to the cache using different types', (test) => {
ava('should add two values to the cache using different types', (test) => {
const cache = new MatcherCache()

@@ -78,0 +78,0 @@

@@ -22,5 +22,5 @@ /*

ava.test('should create an empty cache', (test) => {
ava('should create an empty cache', (test) => {
const cache = new MatcherCache()
test.deepEqual(cache.data, {})
})

@@ -23,3 +23,3 @@ /*

ava.test('should return an empty set if the cache is empty', (test) => {
ava('should return an empty set if the cache is empty', (test) => {
const cache = new MatcherCache()

@@ -29,3 +29,3 @@ test.deepEqual(cache.getTypes(), new Set())

ava.test('should return a single type if there is only one entry', (test) => {
ava('should return a single type if there is only one entry', (test) => {
const cache = new MatcherCache()

@@ -43,3 +43,3 @@

ava.test('should not return duplicated types', (test) => {
ava('should not return duplicated types', (test) => {
const cache = new MatcherCache()

@@ -63,3 +63,3 @@

ava.test('should return all added types', (test) => {
ava('should return all added types', (test) => {
const cache = new MatcherCache()

@@ -83,3 +83,3 @@

ava.test('should not return reset types', (test) => {
ava('should not return reset types', (test) => {
const cache = new MatcherCache()

@@ -86,0 +86,0 @@

@@ -23,3 +23,3 @@ /*

ava.test('should return the value if the matcher was cached', (test) => {
ava('should return the value if the matcher was cached', (test) => {
const cache = new MatcherCache()

@@ -41,3 +41,3 @@

ava.test('should return null if the matcher was not cached', (test) => {
ava('should return null if the matcher was not cached', (test) => {
const cache = new MatcherCache()

@@ -44,0 +44,0 @@

@@ -23,3 +23,3 @@ /*

ava.test('should merge two empty caches', (test) => {
ava('should merge two empty caches', (test) => {
const cache1 = new MatcherCache()

@@ -31,3 +31,3 @@ const cache2 = new MatcherCache()

ava.test('should merge a non empty cache with one type into an empty cache', (test) => {
ava('should merge a non empty cache with one type into an empty cache', (test) => {
const cache1 = new MatcherCache()

@@ -65,3 +65,3 @@ const cache2 = new MatcherCache()

ava.test('should merge a non empty cache with two types into an empty cache', (test) => {
ava('should merge a non empty cache with two types into an empty cache', (test) => {
const cache1 = new MatcherCache()

@@ -101,3 +101,3 @@ const cache2 = new MatcherCache()

ava.test('should merge two non empty caches with disjoint types', (test) => {
ava('should merge two non empty caches with disjoint types', (test) => {
const cache1 = new MatcherCache()

@@ -137,3 +137,3 @@ const cache2 = new MatcherCache()

ava.test('should omit types in common', (test) => {
ava('should omit types in common', (test) => {
const cache1 = new MatcherCache()

@@ -173,3 +173,3 @@ const cache2 = new MatcherCache()

ava.test('should return the instance', (test) => {
ava('should return the instance', (test) => {
const cache1 = new MatcherCache()

@@ -176,0 +176,0 @@ const cache2 = new MatcherCache()

@@ -23,3 +23,3 @@ /*

ava.test('should remove all specified types from the cache', (test) => {
ava('should remove all specified types from the cache', (test) => {
const cache = new MatcherCache()

@@ -58,3 +58,3 @@

ava.test('should do nothing if the type does not exist', (test) => {
ava('should do nothing if the type does not exist', (test) => {
const cache = new MatcherCache()

@@ -61,0 +61,0 @@

@@ -22,3 +22,3 @@ /*

ava.test('should add an object to an empty set', (test) => {
ava('should add an object to an empty set', (test) => {
const set = new ObjectSet()

@@ -37,3 +37,3 @@

ava.test('should add an object to a non empty set', (test) => {
ava('should add an object to a non empty set', (test) => {
const set = new ObjectSet([

@@ -59,3 +59,3 @@ {

ava.test('should not add a duplicate object', (test) => {
ava('should not add a duplicate object', (test) => {
const set = new ObjectSet([

@@ -78,3 +78,3 @@ {

ava.test('should allow the user to set a custom id', (test) => {
ava('should allow the user to set a custom id', (test) => {
const set = new ObjectSet([])

@@ -81,0 +81,0 @@

@@ -22,3 +22,3 @@ /*

ava.test('should create an empty set', (test) => {
ava('should create an empty set', (test) => {
const set = new ObjectSet()

@@ -28,3 +28,3 @@ test.deepEqual(set.getAll(), [])

ava.test('should create a set with objects', (test) => {
ava('should create a set with objects', (test) => {
const set = new ObjectSet([

@@ -49,3 +49,3 @@ {

ava.test('should ignore duplicate objects', (test) => {
ava('should ignore duplicate objects', (test) => {
const set = new ObjectSet([

@@ -67,3 +67,3 @@ {

ava.test('should be able to set objects with custom ids', (test) => {
ava('should be able to set objects with custom ids', (test) => {
const set = new ObjectSet([

@@ -70,0 +70,0 @@ [

@@ -22,3 +22,3 @@ /*

ava.test('should return an empty array if the set is empty', (test) => {
ava('should return an empty array if the set is empty', (test) => {
const set = new ObjectSet()

@@ -28,3 +28,3 @@ test.deepEqual(set.getAll(), [])

ava.test('should return the elements in the set', (test) => {
ava('should return the elements in the set', (test) => {
const set = new ObjectSet([

@@ -31,0 +31,0 @@ {

@@ -22,3 +22,3 @@ /*

ava.test('should return true if the id exists', (test) => {
ava('should return true if the id exists', (test) => {
const set = new ObjectSet()

@@ -41,3 +41,3 @@

ava.test('should return false if the id does not exist', (test) => {
ava('should return false if the id does not exist', (test) => {
const set = new ObjectSet()

@@ -44,0 +44,0 @@

@@ -22,3 +22,3 @@ /*

ava.test('should return true if the object exists', (test) => {
ava('should return true if the object exists', (test) => {
const set = new ObjectSet([

@@ -38,3 +38,3 @@ {

ava.test('should return false if the object does not exist', (test) => {
ava('should return false if the object does not exist', (test) => {
const set = new ObjectSet([

@@ -41,0 +41,0 @@ {

@@ -22,3 +22,3 @@ /*

ava.test('should calculate the intersection of two sets', (test) => {
ava('should calculate the intersection of two sets', (test) => {
const set1 = new ObjectSet()

@@ -52,3 +52,3 @@ const set2 = new ObjectSet()

ava.test('should return the instance', (test) => {
ava('should return the instance', (test) => {
const set1 = new ObjectSet()

@@ -68,3 +68,3 @@ const set2 = new ObjectSet()

ava.test('should calculate the intersection of two disjoint sets', (test) => {
ava('should calculate the intersection of two disjoint sets', (test) => {
const set1 = new ObjectSet()

@@ -90,3 +90,3 @@ const set2 = new ObjectSet()

ava.test('should return an empty array if the left set is empty', (test) => {
ava('should return an empty array if the left set is empty', (test) => {
const set1 = new ObjectSet()

@@ -104,3 +104,3 @@ const set2 = new ObjectSet()

ava.test('should return an empty array if the right set is empty', (test) => {
ava('should return an empty array if the right set is empty', (test) => {
const set1 = new ObjectSet()

@@ -118,3 +118,3 @@ const set2 = new ObjectSet()

ava.test('should take custom ids into account', (test) => {
ava('should take custom ids into account', (test) => {
const set1 = new ObjectSet()

@@ -156,3 +156,3 @@ const set2 = new ObjectSet()

ava.test('should trust ids rather than objects', (test) => {
ava('should trust ids rather than objects', (test) => {
const set1 = new ObjectSet()

@@ -159,0 +159,0 @@ const set2 = new ObjectSet()

@@ -22,3 +22,3 @@ /*

ava.test('should return zero if the set has no objects', (test) => {
ava('should return zero if the set has no objects', (test) => {
const set = new ObjectSet()

@@ -28,3 +28,3 @@ test.is(set.size(), 0)

ava.test('should return one if the set has one object', (test) => {
ava('should return one if the set has one object', (test) => {
const set = new ObjectSet([

@@ -39,3 +39,3 @@ {

ava.test('should return two if the set has two object', (test) => {
ava('should return two if the set has two object', (test) => {
const set = new ObjectSet([

@@ -53,3 +53,3 @@ {

ava.test('should ignore duplicates', (test) => {
ava('should ignore duplicates', (test) => {
const set = new ObjectSet([

@@ -67,3 +67,3 @@ {

ava.test('should change if new objects are added', (test) => {
ava('should change if new objects are added', (test) => {
const set = new ObjectSet()

@@ -70,0 +70,0 @@

@@ -23,3 +23,3 @@ /*

ava.test('should find a partial in a one level structure with one contract of a type', (test) => {
ava('should find a partial in a one level structure with one contract of a type', (test) => {
const contract = new Contract({

@@ -47,3 +47,3 @@ type: 'foo',

ava.test('should find a partial in a one level structure with one alias contract of a type', (test) => {
ava('should find a partial in a one level structure with one alias contract of a type', (test) => {
const contract = new Contract({

@@ -72,3 +72,3 @@ type: 'foo',

ava.test('should find a partial in a one level structure with two alias contracts of a type', (test) => {
ava('should find a partial in a one level structure with two alias contracts of a type', (test) => {
const contract = new Contract({

@@ -103,3 +103,3 @@ type: 'foo',

ava.test('should find a partial in a one level structure with two contracts of a type with one right version', (test) => {
ava('should find a partial in a one level structure with two contracts of a type with one right version', (test) => {
const contract = new Contract({

@@ -134,3 +134,3 @@ type: 'foo',

ava.test('should find a partial in a one level structure with two contracts of a type with one right version', (test) => {
ava('should find a partial in a one level structure with two contracts of a type with one right alias', (test) => {
const contract = new Contract({

@@ -146,32 +146,2 @@ type: 'foo',

name: 'armv7hf',
slug: 'armv7hf'
}),
new Contract({
type: 'arch.sw',
name: 'armel',
slug: 'armel'
})
])
test.deepEqual(partials.findPartial('my-partial', contract, {
baseDirectory: 'path/to/partials',
structure: [ 'arch.sw' ]
}), [
'path/to/partials/armel+armv7hf@3/my-partial.tpl',
'path/to/partials/armel+armv7hf/my-partial.tpl',
'path/to/partials/my-partial.tpl'
])
})
ava.test('should find a partial in a one level structure with two contracts of a type with one right alias', (test) => {
const contract = new Contract({
type: 'foo',
slug: 'bar'
})
contract.addChildren([
new Contract({
type: 'arch.sw',
version: '3',
name: 'armv7hf',
slug: 'armhf',

@@ -197,3 +167,3 @@ canonicalSlug: 'armv7hf'

ava.test('should find a partial in a one level structure with two contracts of a type with one left version', (test) => {
ava('should find a partial in a one level structure with two contracts of a type with one left version', (test) => {
const contract = new Contract({

@@ -228,3 +198,3 @@ type: 'foo',

ava.test('should find a partial in a one level structure with two contracts of a type with one left alias', (test) => {
ava('should find a partial in a one level structure with two contracts of a type with one left alias', (test) => {
const contract = new Contract({

@@ -260,3 +230,3 @@ type: 'foo',

ava.test('should find a partial in a one level structure with two contracts of a type with two versions', (test) => {
ava('should find a partial in a one level structure with two contracts of a type with two versions', (test) => {
const contract = new Contract({

@@ -292,3 +262,3 @@ type: 'foo',

ava.test('should find a partial in a one level structure with one contract of a type with a version', (test) => {
ava('should find a partial in a one level structure with one contract of a type with a version', (test) => {
const contract = new Contract({

@@ -318,3 +288,3 @@ type: 'foo',

ava.test('should find a partial in a two level structure with one contract of each type', (test) => {
ava('should find a partial in a two level structure with one contract of each type', (test) => {
const contract = new Contract({

@@ -348,3 +318,3 @@ type: 'foo',

ava.test('should find a partial in a two level structure with one contract of each type with versions', (test) => {
ava('should find a partial in a two level structure with one contract of each type with versions', (test) => {
const contract = new Contract({

@@ -384,3 +354,3 @@ type: 'foo',

ava.test('should find a partial in a three level structure with one contract of each type', (test) => {
ava('should find a partial in a three level structure with one contract of each type', (test) => {
const contract = new Contract({

@@ -420,3 +390,3 @@ type: 'foo',

ava.test('should find a partial in a three level structure with one contract with version of each type', (test) => {
ava('should find a partial in a three level structure with one contract with version of each type', (test) => {
const contract = new Contract({

@@ -423,0 +393,0 @@ type: 'foo',

@@ -22,3 +22,3 @@ /*

ava.test('should compile a contract without templates', (test) => {
ava('should compile a contract without templates', (test) => {
test.deepEqual(template.compileContract({

@@ -37,3 +37,3 @@ type: 'distro',

ava.test('should compile a single top level template', (test) => {
ava('should compile a single top level template', (test) => {
test.deepEqual(template.compileContract({

@@ -52,3 +52,3 @@ type: 'distro',

ava.test('should compile templates inside arrays', (test) => {
ava('should compile templates inside arrays', (test) => {
test.deepEqual(template.compileContract({

@@ -85,3 +85,3 @@ type: 'distro',

ava.test('should compile multiple top level templates', (test) => {
ava('should compile multiple top level templates', (test) => {
test.deepEqual(template.compileContract({

@@ -100,3 +100,3 @@ type: 'distro',

ava.test('should compile a single nested template', (test) => {
ava('should compile a single nested template', (test) => {
test.deepEqual(template.compileContract({

@@ -129,3 +129,3 @@ type: 'distro',

ava.test('should leave missing values as interpolations', (test) => {
ava('should leave missing values as interpolations', (test) => {
test.deepEqual(template.compileContract({

@@ -144,3 +144,3 @@ type: 'distro',

ava.test('should be able to blacklist a top level element', (test) => {
ava('should be able to blacklist a top level element', (test) => {
const result = template.compileContract({

@@ -169,3 +169,3 @@ type: 'distro',

ava.test('should be able to blacklist a nested element', (test) => {
ava('should be able to blacklist a nested element', (test) => {
const result = template.compileContract({

@@ -200,3 +200,3 @@ type: 'distro',

ava.test('should be able to blacklist more than one element', (test) => {
ava('should be able to blacklist more than one element', (test) => {
const result = template.compileContract({

@@ -231,3 +231,3 @@ type: 'distro',

ava.test('should be able to blacklist elements inside arrays', (test) => {
ava('should be able to blacklist elements inside arrays', (test) => {
const result = template.compileContract({

@@ -256,3 +256,3 @@ slug: 'debian',

ava.test('should be able to blacklist a whole subtree', (test) => {
ava('should be able to blacklist a whole subtree', (test) => {
const result = template.compileContract({

@@ -259,0 +259,0 @@ type: 'distro',

@@ -22,3 +22,3 @@ /*

ava.test('should return true if sets are disjoint', (test) => {
ava('should return true if sets are disjoint', (test) => {
const set1 = new Set([ 'foo', 'bar' ])

@@ -31,3 +31,3 @@ const set2 = new Set([ 'baz', 'qux' ])

ava.test('should return false if sets are not disjoint', (test) => {
ava('should return false if sets are not disjoint', (test) => {
const set1 = new Set([ 'foo', 'bar' ])

@@ -40,7 +40,7 @@ const set2 = new Set([ 'bar', 'baz' ])

ava.test('should return true if both sets are empty', (test) => {
ava('should return true if both sets are empty', (test) => {
test.true(utils.areSetsDisjoint(new Set(), new Set()))
})
ava.test('should return true if one of the sets is empty', (test) => {
ava('should return true if one of the sets is empty', (test) => {
const set1 = new Set([ 'foo', 'bar' ])

@@ -47,0 +47,0 @@ const set2 = new Set()

@@ -23,3 +23,3 @@ /*

ava.test('should perform a cartesian product of empty sets', (test) => {
ava('should perform a cartesian product of empty sets', (test) => {
const product = utils.cartesianProductWith([

@@ -36,3 +36,3 @@ [],

ava.test('should perform a cartesian product of a valid an and empty set', (test) => {
ava('should perform a cartesian product of a valid an and empty set', (test) => {
const product = utils.cartesianProductWith([

@@ -49,3 +49,3 @@ [ 'foo' ],

ava.test('should perform a cartesian product of no sets', (test) => {
ava('should perform a cartesian product of no sets', (test) => {
const product = utils.cartesianProductWith([], (accumulator, element) => {

@@ -58,3 +58,3 @@ return _.concat(accumulator, [ element ])

ava.test('should perform a cartesian product of a one element set', (test) => {
ava('should perform a cartesian product of a one element set', (test) => {
const product = utils.cartesianProductWith([

@@ -71,3 +71,3 @@ [ 'foo' ]

ava.test('should calculate the cartesian product of two string sets', (test) => {
ava('should calculate the cartesian product of two string sets', (test) => {
const product = utils.cartesianProductWith([

@@ -93,3 +93,3 @@ [ 'hello', 'hi', 'hey' ],

ava.test('should be able to discard combinations by returning undefined', (test) => {
ava('should be able to discard combinations by returning undefined', (test) => {
const product = utils.cartesianProductWith([

@@ -123,3 +123,3 @@ [ 'hello', 'hi', 'hey' ],

ava.test('should be able to discard combinations on a 3 sets product', (test) => {
ava('should be able to discard combinations on a 3 sets product', (test) => {
const product = utils.cartesianProductWith([

@@ -126,0 +126,0 @@ [ 1, 2, 3 ],

@@ -22,3 +22,3 @@ /*

ava.test('should return undefined given an empty set', (test) => {
ava('should return undefined given an empty set', (test) => {
const set = new Set()

@@ -28,3 +28,3 @@ test.deepEqual(utils.setFirst(set), undefined)

ava.test('should return the element given an empty set with one element', (test) => {
ava('should return the element given an empty set with one element', (test) => {
const set = new Set([ 'foo' ])

@@ -34,3 +34,3 @@ test.deepEqual(utils.setFirst(set), 'foo')

ava.test('should always return the only element', (test) => {
ava('should always return the only element', (test) => {
const set = new Set([ 'foo' ])

@@ -43,5 +43,5 @@ test.deepEqual(utils.setFirst(set), 'foo')

ava.test('should return one of the elements given a set with more than one element', (test) => {
ava('should return one of the elements given a set with more than one element', (test) => {
const set = new Set([ 'foo', 'bar', 'baz' ])
test.true(set.has(utils.setFirst(set)))
})

@@ -22,3 +22,3 @@ /*

ava.test('should return an empty array given an empty set', (test) => {
ava('should return an empty array given an empty set', (test) => {
const set = new Set()

@@ -30,3 +30,3 @@ test.deepEqual(utils.setMap(set, (element) => {

ava.test('should run the iteratee on all elements', (test) => {
ava('should run the iteratee on all elements', (test) => {
const set = new Set([ 1, 2, 3 ])

@@ -33,0 +33,0 @@ test.deepEqual(utils.setMap(set, (element) => {

@@ -22,3 +22,3 @@ /*

ava.test('should return an empty set for the union of two empty sets', (test) => {
ava('should return an empty set for the union of two empty sets', (test) => {
const set1 = new Set()

@@ -31,3 +31,3 @@ const set2 = new Set()

ava.test('should return the union of two disjoint sets', (test) => {
ava('should return the union of two disjoint sets', (test) => {
const set1 = new Set([ 1, 2 ])

@@ -40,3 +40,3 @@ const set2 = new Set([ 3, 4 ])

ava.test('should return the union of two joint sets', (test) => {
ava('should return the union of two joint sets', (test) => {
const set1 = new Set([ 1, 2 ])

@@ -49,3 +49,3 @@ const set2 = new Set([ 2, 3 ])

ava.test('should return an inverted result if the arguments are flipped', (test) => {
ava('should return an inverted result if the arguments are flipped', (test) => {
const set1 = new Set([ 1, 2 ])

@@ -61,3 +61,3 @@ const set2 = new Set([ 3, 4 ])

ava.test('should return the first set if the second one is empty', (test) => {
ava('should return the first set if the second one is empty', (test) => {
const set1 = new Set([ 1, 2 ])

@@ -69,3 +69,3 @@ const set2 = new Set()

ava.test('should return the second set if the first one is empty', (test) => {
ava('should return the second set if the first one is empty', (test) => {
const set1 = new Set()

@@ -72,0 +72,0 @@ const set2 = new Set([ 1, 2 ])

@@ -23,3 +23,3 @@ /*

ava.test('should replace two blank lines with one', (test) => {
ava('should replace two blank lines with one', (test) => {
const result = _.split(utils.stripExtraBlankLines(_.join([

@@ -44,3 +44,3 @@ 'Hello',

ava.test('should replace three blank lines with one', (test) => {
ava('should replace three blank lines with one', (test) => {
const result = _.split(utils.stripExtraBlankLines(_.join([

@@ -67,3 +67,3 @@ 'Hello',

ava.test('should remove a single leading blank line', (test) => {
ava('should remove a single leading blank line', (test) => {
const result = _.split(utils.stripExtraBlankLines(_.join([

@@ -79,3 +79,3 @@ '',

ava.test('should remove two leading blank lines', (test) => {
ava('should remove two leading blank lines', (test) => {
const result = _.split(utils.stripExtraBlankLines(_.join([

@@ -92,3 +92,3 @@ '',

ava.test('should remove a single trailing blank line', (test) => {
ava('should remove a single trailing blank line', (test) => {
const result = _.split(utils.stripExtraBlankLines(_.join([

@@ -104,3 +104,3 @@ 'Hello',

ava.test('should remove two trailing blank lines', (test) => {
ava('should remove two trailing blank lines', (test) => {
const result = _.split(utils.stripExtraBlankLines(_.join([

@@ -107,0 +107,0 @@ 'Hello',

@@ -22,3 +22,3 @@ /*

ava.test('should build a contract with no variants', (test) => {
ava('should build a contract with no variants', (test) => {
test.deepEqual(variants.build({

@@ -37,3 +37,3 @@ slug: 'debian',

ava.test('should build a contract with empty variants', (test) => {
ava('should build a contract with empty variants', (test) => {
test.deepEqual(variants.build({

@@ -53,3 +53,3 @@ slug: 'debian',

ava.test('should build a contract with two variants', (test) => {
ava('should build a contract with two variants', (test) => {
test.deepEqual(variants.build({

@@ -120,3 +120,3 @@ slug: 'nodejs_{{data.arch}}',

ava.test('should supported nested variants', (test) => {
ava('should supported nested variants', (test) => {
test.deepEqual(variants.build({

@@ -218,3 +218,3 @@ slug: 'nodejs_{{data.arch}}',

ava.test('should merge arrays correctly', (test) => {
ava('should merge arrays correctly', (test) => {
test.deepEqual(variants.build({

@@ -221,0 +221,0 @@ slug: 'foo',

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc