-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: stackUtils.changeRegion, add tests
- Loading branch information
Showing
6 changed files
with
20,439 additions
and
13 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
6,777 changes: 6,777 additions & 0 deletions
6,777
src/test/fixtures/cloudformation-template-ap-southeast-2.json
Large diffs are not rendered by default.
Oops, something went wrong.
6,777 changes: 6,777 additions & 0 deletions
6,777
src/test/fixtures/cloudformation-template-yossarian.json
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
|
||
require('./env').install() | ||
|
||
// import fs from 'fs' | ||
// import path from 'path' | ||
import test from 'tape' | ||
import _ from 'lodash' | ||
|
||
import { stableStringify } from '../string-utils' | ||
import { | ||
loudAsync, | ||
} from '../utils' | ||
|
||
import { StackUtils } from '../stack-utils' | ||
|
||
const virginia = require('./fixtures/cloudformation-template.json') | ||
const sydney = require('./fixtures/cloudformation-template-ap-southeast-2.json') | ||
const yossarian = require('./fixtures/cloudformation-template-yossarian.json') | ||
|
||
test('change region', t => { | ||
const hopefullySydney = StackUtils.changeRegion({ | ||
template: virginia, | ||
from: 'us-east-1', | ||
to: 'ap-southeast-2', | ||
}) | ||
|
||
// fs.writeFileSync(path.resolve(__dirname, '../../src/test/fixtures/cloudformation-template-ap-southeast-2.json'), stableStringify(hopefullySydney, { space: 2 })) | ||
// fs.writeFileSync(path.resolve(__dirname, './fixtures/cloudformation-template-ap-southeast-2.json'), stableStringify(hopefullySydney, { space: 2 })) | ||
t.same(hopefullySydney, sydney) | ||
t.end() | ||
}) | ||
|
||
test('change service name', t => { | ||
const hopefullyYossarian = StackUtils.changeServiceName({ | ||
template: virginia, | ||
from: 'tdl-tradle-ltd', | ||
to: 'tdl-yossarian-ltd', | ||
}) | ||
|
||
// fs.writeFileSync(path.resolve(__dirname, '../../src/test/fixtures/cloudformation-template-yossarian.json'), stableStringify(hopefullyYossarian, { space: 2 })) | ||
// fs.writeFileSync(path.resolve(__dirname, './fixtures/cloudformation-template-yossarian.json'), stableStringify(hopefullyYossarian, { space: 2 })) | ||
t.same(hopefullyYossarian, yossarian) | ||
t.end() | ||
}) |