1
0
mirror of https://github.com/flarum/core.git synced 2025-08-11 02:44:04 +02:00

Hello world!

This commit is contained in:
Toby Zerner
2014-12-20 16:56:46 +10:30
commit 74db323f83
279 changed files with 11954 additions and 0 deletions

73
ember/tests/.jshintrc Normal file
View File

@@ -0,0 +1,73 @@
{
"predef": [
"document",
"window",
"location",
"setTimeout",
"$",
"QUnit",
"define",
"console",
"equal",
"notEqual",
"notStrictEqual",
"test",
"asyncTest",
"testBoth",
"testWithDefault",
"raises",
"throws",
"deepEqual",
"start",
"stop",
"ok",
"strictEqual",
"module",
"moduleFor",
"moduleForComponent",
"moduleForModel",
"process",
"expect",
"visit",
"exists",
"fillIn",
"click",
"keyEvent",
"find",
"findWithAssert",
"wait",
"DS",
"keyEvent",
"isolatedContainer",
"startApp",
"andThen",
"currentURL",
"currentPath",
"currentRouteName"
],
"node": false,
"browser": false,
"boss": true,
"curly": false,
"debug": false,
"devel": false,
"eqeqeq": true,
"evil": true,
"forin": false,
"immed": false,
"laxbreak": false,
"newcap": true,
"noarg": true,
"noempty": false,
"nonew": false,
"nomen": false,
"onevar": false,
"plusplus": false,
"regexp": false,
"undef": true,
"sub": true,
"strict": false,
"white": false,
"eqnull": true,
"esnext": true
}

View File

@@ -0,0 +1,9 @@
import Resolver from 'ember/resolver';
var resolver = Resolver.create();
resolver.namespace = {
modulePrefix: 'flarum'
};
export default resolver;

View File

@@ -0,0 +1,30 @@
/* global require */
var Application = require('flarum/app')['default'];
var Router = require('flarum/router')['default'];
import Ember from 'ember';
export default function startApp(attrs) {
var App;
var attributes = Ember.merge({
// useful Test defaults
rootElement: '#ember-testing',
LOG_ACTIVE_GENERATION:false,
LOG_VIEW_LOOKUPS: false
}, attrs); // but you can override;
Router.reopen({
location: 'none'
});
Ember.run(function(){
App = Application.create(attributes);
App.setupForTesting();
App.injectTestHelpers();
});
App.reset(); // this shouldn't be needed, i want to be able to "start an app at a specific URL"
return App;
}

49
ember/tests/index.html Normal file
View File

@@ -0,0 +1,49 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Flarum Tests</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
{{BASE_TAG}}
<link rel="stylesheet" href="assets/vendor.css">
<link rel="stylesheet" href="assets/flarum.css">
<link rel="stylesheet" href="assets/test-support.css">
<style>
#ember-testing-container {
position: absolute;
background: white;
bottom: 0;
right: 0;
width: 640px;
height: 384px;
overflow: auto;
z-index: 9999;
border: 1px solid #ccc;
}
#ember-testing {
zoom: 50%;
}
</style>
</head>
<body>
<div id="qunit"></div>
<div id="qunit-fixture"></div>
<script>
window.FlarumENV = {{ENV}};
window.EmberENV = window.FlarumENV.EmberENV;
</script>
<script src="assets/test-support.js"></script>
<script src="assets/vendor.js"></script>
<script src="assets/flarum.js"></script>
<script src="testem.js"></script>
<script>
require('flarum/tests/test-helper');
</script>
<script src="assets/test-loader.js"></script>
</body>
</html>

View File

@@ -0,0 +1,6 @@
import resolver from './helpers/resolver';
import { setResolver } from 'ember-qunit';
setResolver(resolver);
document.write('<div id="ember-testing-container"><div id="ember-testing"></div></div>');

View File