This repository has been archived by the owner on May 17, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(config): difined the travis config file
- Loading branch information
Showing
7 changed files
with
124 additions
and
11 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,8 @@ | ||
import writeYaml from '../third-party-wrappers/write-yaml'; | ||
|
||
export default function ({projectRoot}) { | ||
return writeYaml( | ||
`${projectRoot}/.travis.yml`, | ||
{language: 'generic', notifications: {email: false}, install: 'bpkg getdeps', script: 'make test'} | ||
); | ||
} |
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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
export default function () { | ||
import scaffoldConfig from './config'; | ||
|
||
export default async function ({projectRoot}) { | ||
await scaffoldConfig({projectRoot}); | ||
|
||
return {}; | ||
} |
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,35 @@ | ||
import sinon from 'sinon'; | ||
import {assert} from 'chai'; | ||
import any from '@travi/any'; | ||
import * as yamlWriter from '../../third-party-wrappers/write-yaml'; | ||
import scaffoldConfig from '../../src/config'; | ||
|
||
suite('config file generation', () => { | ||
let sandbox; | ||
const projectRoot = any.string(); | ||
|
||
setup(() => { | ||
sandbox = sinon.createSandbox(); | ||
|
||
sandbox.stub(yamlWriter, 'default'); | ||
|
||
yamlWriter.default.resolves(); | ||
}); | ||
|
||
teardown(() => sandbox.restore()); | ||
|
||
test('that a base config is created for a shell project', async () => { | ||
await scaffoldConfig({projectRoot}); | ||
|
||
assert.calledWith( | ||
yamlWriter.default, | ||
`${projectRoot}/.travis.yml`, | ||
{ | ||
language: 'generic', | ||
notifications: {email: false}, | ||
install: 'bpkg getdeps', | ||
script: 'make test' | ||
} | ||
); | ||
}); | ||
}); |
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 |
---|---|---|
@@ -1,8 +1,24 @@ | ||
import {assert} from 'chai'; | ||
import any from '@travi/any'; | ||
import sinon from 'sinon'; | ||
import * as configScaffolder from '../../src/config'; | ||
import {scaffold} from '../../src'; | ||
|
||
suite('scaffolder', () => { | ||
test('that the config is scaffolded', () => { | ||
assert.deepEqual(scaffold(), {}); | ||
let sandbox; | ||
|
||
setup(() => { | ||
sandbox = sinon.createSandbox(); | ||
|
||
sandbox.stub(configScaffolder, 'default'); | ||
}); | ||
|
||
teardown(() => sandbox.restore()); | ||
|
||
test('that the config is scaffolded', async () => { | ||
const projectRoot = any.string(); | ||
|
||
assert.deepEqual(await scaffold({projectRoot}), {}); | ||
assert.calledWith(configScaffolder.default, {projectRoot}); | ||
}); | ||
}); |
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,4 @@ | ||
import {promisify} from 'util'; | ||
import yaml from 'write-yaml'; | ||
|
||
export default promisify(yaml); |