File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change 2
2
3
3
const DebugToolsPlugin = require ( '..' ) ;
4
4
const fs = require ( 'fs' ) ;
5
+ const CONSOLE = Object . assign ( { } , console ) ;
5
6
6
7
function createTests ( options ) {
7
8
const babelVersion = options . babelVersion ;
8
9
const presets = options . presets ;
9
10
const transform = options . transform ;
10
11
12
+ afterEach ( function ( ) {
13
+ Object . assign ( console , CONSOLE ) ;
14
+ } ) ;
15
+
11
16
describe ( 'Feature Flags' , function ( ) {
12
17
const h = transformTestHelper ( {
13
18
presets,
@@ -154,6 +159,10 @@ function createTests(options) {
154
159
} ) ;
155
160
156
161
describe ( 'ember-cli-babel default configuration (legacy config API)' , function ( ) {
162
+ beforeEach ( function ( ) {
163
+ console . warn = ( ) => { } ; // eslint-disable-line
164
+ } ) ;
165
+
157
166
let h = transformTestHelper ( {
158
167
presets,
159
168
plugins : [
Original file line number Diff line number Diff line change 3
3
const normalizeOptions = require ( '../src/utils/normalize-options' ) . normalizeOptions ;
4
4
5
5
describe ( 'normalizeOptions' , function ( ) {
6
+ let originalConsole = Object . assign ( { } , console ) ;
7
+
8
+ afterEach ( function ( ) {
9
+ Object . assign ( console , originalConsole ) ;
10
+ } ) ;
11
+
6
12
it ( 'converts "old style" options into the newer style (with deprecation)' , function ( ) {
13
+ let warnings = [ ] ;
14
+ console . warn = warning => warnings . push ( warning ) ; // eslint-disable-line
15
+
7
16
let actual = normalizeOptions ( {
8
17
envFlags : {
9
18
source : '@ember/env-flags' ,
@@ -39,6 +48,9 @@ describe('normalizeOptions', function() {
39
48
} ;
40
49
41
50
expect ( actual ) . toEqual ( expected ) ;
51
+ expect ( warnings ) . toEqual ( [
52
+ 'babel-plugin-debug-macros configuration API has changed, please update your configuration' ,
53
+ ] ) ;
42
54
} ) ;
43
55
44
56
it ( 'sets flag to false when svelte version matches the flag version' , function ( ) {
You can’t perform that action at this time.
0 commit comments