-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix all tests + handling of dotfiles, notfound, and nojekyll for Comm…
…ander vs. Angular CLI (#180) * fix jest / ts-jest setup * Looks like the angularfire team has now changed their setup like this: https://github.com/angular/angularfire/blob/master/package.json only dependencies and devDependencies, no peerDependencies any longer. And they skipped all previous version, too. So I think I will try this out too: * fixing snapshot file * remove support for deprecated defaultProject setting * fix all unit tests * tests for Commander CLI Options * tests for Angular CLI options * remove own consoleLogger * 2.0.0-beta.2 * Update docs/README_standalone.md Co-authored-by: Ferdinand Malcher <ferdinand@malcher.media> * Update docs/README_standalone.md Co-authored-by: Ferdinand Malcher <ferdinand@malcher.media> * Update docs/README_standalone.md Co-authored-by: Ferdinand Malcher <ferdinand@malcher.media> --------- Co-authored-by: Ferdinand Malcher <ferdinand@malcher.media>
- Loading branch information
1 parent
95d8603
commit cb7a1cb
Showing
15 changed files
with
132 additions
and
166 deletions.
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
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,33 @@ | ||
import path from 'path'; | ||
import fs from 'fs'; | ||
|
||
import { execSync } from 'child_process'; | ||
|
||
|
||
function runCliWithArgs(args) { | ||
|
||
const distFolder = path.resolve(__dirname, 'dist'); | ||
|
||
if (!fs.existsSync(distFolder)) { | ||
throw new Error(`Dist directory ${distFolder} not found. Can't execute test! The directory must exist from the last build.`); | ||
} | ||
const program = path.resolve(__dirname, 'dist/angular-cli-ghpages'); | ||
return execSync(`node ${program} --dry-run ${args}`).toString(); | ||
} | ||
|
||
describe('Commander CLI options', () => { | ||
|
||
test('should set dotfiles, notfound, and nojekyll to `true` by default', () => { | ||
const output = runCliWithArgs(''); | ||
expect(output).toContain(`"dotfiles": "files starting with dot ('.') will be included"`); | ||
expect(output).toContain('"notfound": "a 404.html file will be created"'); | ||
expect(output).toContain('"nojekyll": "a .nojekyll file will be created"'); | ||
}); | ||
|
||
test('should set dotfiles, notfound, and nojekyll to `false` with no- flags', () => { | ||
const output = runCliWithArgs('--no-dotfiles --no-notfound --no-nojekyll'); | ||
expect(output).toMatch(`"dotfiles": "files starting with dot ('.') will be ignored"`); | ||
expect(output).toMatch('"notfound": "a 404.html file will NOT be created"'); | ||
expect(output).toMatch('"nojekyll": "a .nojekyll file will NOT be created"'); | ||
}); | ||
}); |
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 was deleted.
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
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,5 @@ | ||
/** @type {import('ts-jest').JestConfigWithTsJest} */ | ||
module.exports = { | ||
preset: 'ts-jest', | ||
testEnvironment: 'node' | ||
}; |
Oops, something went wrong.