-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #535 from WillBAnders/fix/missing-cname-option
fix: Add missing cname option not passed to the config
- Loading branch information
Showing
9 changed files
with
51 additions
and
1 deletion.
There are no files selected for viewing
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
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,38 @@ | ||
const helper = require('../helper.js'); | ||
const ghPages = require('../../lib/index.js'); | ||
const path = require('path'); | ||
|
||
const fixtures = path.join(__dirname, 'fixtures'); | ||
const fixtureName = 'cname-exists'; | ||
|
||
beforeEach(() => { | ||
ghPages.clean(); | ||
}); | ||
|
||
describe('the --cname option', () => { | ||
it('works even if the CNAME file already exists AND replaces any existing value', (done) => { | ||
const local = path.join(fixtures, fixtureName, 'local'); | ||
const expected = path.join(fixtures, fixtureName, 'expected'); | ||
const branch = 'gh-pages'; | ||
|
||
helper.setupRemote(fixtureName, {branch}).then((url) => { | ||
const options = { | ||
repo: url, | ||
user: { | ||
name: 'User Name', | ||
email: 'user@email.com', | ||
}, | ||
cname: 'custom-domain.com', | ||
}; | ||
ghPages.publish(local, options, (err) => { | ||
if (err) { | ||
return done(err); | ||
} | ||
helper | ||
.assertContentsMatch(expected, url, branch) | ||
.then(() => done()) | ||
.catch(done); | ||
}); | ||
}); | ||
}); | ||
}); |
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 @@ | ||
custom-domain.com |
1 change: 1 addition & 0 deletions
1
test/integration/fixtures/cname-exists/expected/hello-world.txt
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 @@ | ||
Hello World! |
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 @@ | ||
Hello World! |
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 @@ | ||
existing-domain.com |
Empty file.