-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Chris Thoburn <runspired@gmail.com>
- Loading branch information
Showing
21 changed files
with
363 additions
and
65 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* eslint node/no-unpublished-require: 'off' */ | ||
|
||
'use strict'; | ||
|
||
const EmberAddon = require('ember-cli/lib/broccoli/ember-addon'); | ||
|
||
const isProd = true; | ||
const compatWith = process.env.COMPAT_WITH || '0.0.0'; | ||
|
||
module.exports = function(defaults) { | ||
let app = new EmberAddon(defaults, { | ||
emberData: { | ||
compatWith, | ||
}, | ||
babel: { | ||
// this ensures that the same build-time code stripping that is done | ||
// for library packages is also done for our tests and dummy app | ||
plugins: [...require('@ember-data/private-build-infra/src/debug-macros')(null, isProd, compatWith)], | ||
}, | ||
'ember-cli-babel': { | ||
throwUnlessParallelizable: true, | ||
}, | ||
}); | ||
|
||
return app.toTree(); | ||
}; |
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,21 @@ | ||
module.exports = { | ||
test_page: 'tests/index.html?hidepassed', | ||
disable_watching: true, | ||
launch_in_ci: ['Chrome'], | ||
launch_in_dev: ['Chrome'], | ||
browser_start_timeout: 120, | ||
browser_args: { | ||
Chrome: { | ||
ci: [ | ||
// --no-sandbox is needed when running Chrome inside a container | ||
process.env.CI ? '--no-sandbox' : null, | ||
'--headless', | ||
'--disable-dev-shm-usage', | ||
'--disable-software-rasterizer', | ||
'--mute-audio', | ||
'--remote-debugging-port=0', | ||
'--window-size=1440,900', | ||
].filter(Boolean), | ||
}, | ||
}, | ||
}; |
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,12 @@ | ||
import Application from '@ember/application'; | ||
import Resolver from './resolver'; | ||
import loadInitializers from 'ember-load-initializers'; | ||
import config from './config/environment'; | ||
|
||
export default class App extends Application { | ||
modulePrefix = config.modulePrefix; | ||
podModulePrefix = config.podModulePrefix; | ||
Resolver = Resolver; | ||
} | ||
|
||
loadInitializers(App, config.modulePrefix); |
25 changes: 25 additions & 0 deletions
25
packages/unpublished-test-infra/tests/dummy/app/index.html
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,25 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<title>Dummy</title> | ||
<meta name="description" content=""> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
|
||
{{content-for "head"}} | ||
|
||
<link integrity="" rel="stylesheet" href="{{rootURL}}assets/vendor.css"> | ||
<link integrity="" rel="stylesheet" href="{{rootURL}}assets/dummy.css"> | ||
|
||
{{content-for "head-footer"}} | ||
</head> | ||
<body> | ||
{{content-for "body"}} | ||
|
||
<script src="{{rootURL}}assets/vendor.js"></script> | ||
<script src="{{rootURL}}assets/dummy.js"></script> | ||
|
||
{{content-for "body-footer"}} | ||
</body> | ||
</html> |
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,3 @@ | ||
import Resolver from 'ember-resolver'; | ||
|
||
export default Resolver; |
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,9 @@ | ||
import EmberRouter from '@ember/routing/router'; | ||
import config from './config/environment'; | ||
|
||
export default class Router extends EmberRouter { | ||
location = config.locationType; | ||
rootURL = config.rootURL; | ||
} | ||
|
||
Router.map(function() {}); |
6 changes: 6 additions & 0 deletions
6
packages/unpublished-test-infra/tests/dummy/app/routes/application/template.hbs
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,6 @@ | ||
<ul> | ||
<li> | ||
<a href='/tests?hidepassed'>Tests</a> | ||
</li> | ||
</ul> | ||
{{outlet}} |
Empty file.
1 change: 1 addition & 0 deletions
1
packages/unpublished-test-infra/tests/dummy/app/templates/application.hbs
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 @@ | ||
{{outlet}} |
52 changes: 52 additions & 0 deletions
52
packages/unpublished-test-infra/tests/dummy/config/environment.js
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,52 @@ | ||
'use strict'; | ||
|
||
module.exports = function(environment) { | ||
let ENV = { | ||
modulePrefix: 'dummy', | ||
environment, | ||
rootURL: '/', | ||
locationType: 'auto', | ||
EmberENV: { | ||
FEATURES: { | ||
// Here you can enable experimental features on an ember canary build | ||
// e.g. EMBER_NATIVE_DECORATOR_SUPPORT: true | ||
}, | ||
EXTEND_PROTOTYPES: { | ||
// Prevent Ember Data from overriding Date.parse. | ||
Date: false, | ||
}, | ||
}, | ||
|
||
APP: { | ||
// Here you can pass flags/options to your application instance | ||
// when it is created | ||
}, | ||
compatWith: process.env.COMPAT_WITH, | ||
}; | ||
|
||
if (environment === 'development') { | ||
// ENV.APP.LOG_RESOLVER = true; | ||
// ENV.APP.LOG_ACTIVE_GENERATION = true; | ||
// ENV.APP.LOG_TRANSITIONS = true; | ||
// ENV.APP.LOG_TRANSITIONS_INTERNAL = true; | ||
// ENV.APP.LOG_VIEW_LOOKUPS = true; | ||
} | ||
|
||
if (environment === 'test') { | ||
// Testem prefers this... | ||
ENV.locationType = 'none'; | ||
|
||
// keep test console output quieter | ||
ENV.APP.LOG_ACTIVE_GENERATION = false; | ||
ENV.APP.LOG_VIEW_LOOKUPS = false; | ||
|
||
ENV.APP.rootElement = '#ember-testing'; | ||
ENV.APP.autoboot = false; | ||
} | ||
|
||
if (environment === 'production') { | ||
// here you can enable a production-specific feature | ||
} | ||
|
||
return ENV; | ||
}; |
3 changes: 3 additions & 0 deletions
3
packages/unpublished-test-infra/tests/dummy/config/optional-features.json
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,3 @@ | ||
{ | ||
"jquery-integration": false | ||
} |
14 changes: 14 additions & 0 deletions
14
packages/unpublished-test-infra/tests/dummy/config/targets.js
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,14 @@ | ||
'use strict'; | ||
|
||
const browsers = ['last 1 Chrome versions', 'last 1 Firefox versions', 'last 1 Safari versions']; | ||
|
||
const isCI = !!process.env.CI; | ||
const isProduction = process.env.EMBER_ENV === 'production'; | ||
|
||
if (isCI || isProduction) { | ||
browsers.push('ie 11'); | ||
} | ||
|
||
module.exports = { | ||
browsers, | ||
}; |
Empty file.
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 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<title>Dummy Tests</title> | ||
<meta name="description" content=""> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
|
||
{{content-for "head"}} | ||
{{content-for "test-head"}} | ||
|
||
<link rel="stylesheet" href="{{rootURL}}assets/vendor.css"> | ||
<link rel="stylesheet" href="{{rootURL}}assets/dummy.css"> | ||
<link rel="stylesheet" href="{{rootURL}}assets/test-support.css"> | ||
|
||
{{content-for "head-footer"}} | ||
{{content-for "test-head-footer"}} | ||
</head> | ||
<body> | ||
{{content-for "body"}} | ||
{{content-for "test-body"}} | ||
|
||
<script src="/testem.js" integrity=""></script> | ||
<script src="{{rootURL}}assets/vendor.js"></script> | ||
<script src="{{rootURL}}assets/test-support.js"></script> | ||
<script src="{{rootURL}}assets/dummy.js"></script> | ||
<script src="{{rootURL}}assets/tests.js"></script> | ||
|
||
{{content-for "body-footer"}} | ||
{{content-for "test-body-footer"}} | ||
</body> | ||
</html> |
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 Application from '../app'; | ||
import config from '../config/environment'; | ||
import { setApplication } from '@ember/test-helpers'; | ||
import { start } from 'ember-qunit'; | ||
|
||
setApplication(Application.create(config.APP)); | ||
|
||
start(); |
Empty file.
23 changes: 23 additions & 0 deletions
23
packages/unpublished-test-infra/tests/unit/deprecations-stripped-test.js
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,23 @@ | ||
import { module, test } from 'ember-qunit'; | ||
import config from 'dummy/config/environment'; | ||
import { DEPRECATE_EVENTED_API_USAGE } from '@ember-data/private-build-infra/deprecations'; | ||
|
||
const { compatWith } = config; | ||
|
||
module('test compatWith', function() { | ||
test('deprecation strips', function(assert) { | ||
let deprecation_stripped = true; | ||
|
||
if (DEPRECATE_EVENTED_API_USAGE) { | ||
deprecation_stripped = false; | ||
} | ||
|
||
if (compatWith === '3.0' || compatWith === '3.8') { | ||
assert.equal(deprecation_stripped, false, 'deprecation code was not stripped'); | ||
} else if (compatWith === '3.12' || compatWith === '3.16' || compatWith === '99.0') { | ||
assert.equal(deprecation_stripped, true, 'deprecation code was stripped'); | ||
} else { | ||
// do nothing | ||
} | ||
}); | ||
}); |
Oops, something went wrong.