-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
155 additions
and
105 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
{ | ||
"presets": ["stage-0", "es2015"] | ||
"presets": ["es2015", "stage-0"], | ||
"plugins": [ | ||
"transform-es3-member-expression-literals", | ||
"transform-es3-property-literals" | ||
] | ||
} |
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 |
---|---|---|
@@ -1,7 +1,9 @@ | ||
node_modules | ||
.DS_Store | ||
npm-debug.log | ||
tmp | ||
*~ | ||
lib | ||
dist | ||
coverage | ||
tests | ||
tmp |
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
src | ||
bench | ||
coverage | ||
tmp | ||
test |
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,19 @@ | ||
const webpackConfig = require('./webpack.config') | ||
|
||
module.exports = (config) => { | ||
config.set({ | ||
browsers: ['Chrome'], | ||
frameworks: ['mocha'], | ||
files: ['tests.webpack.js'], | ||
preprocessors: { | ||
'tests.webpack.js': ['webpack', 'sourcemap'] | ||
}, | ||
webpack: Object.assign(webpackConfig, { | ||
devtool: 'inline-source-map' | ||
}), | ||
webpackServer: { | ||
noInfo: true | ||
}, | ||
reporters: ['mocha'] | ||
}) | ||
} |
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,62 @@ | ||
import expect from 'expect.js' | ||
|
||
import {prefix, supportedProperty, supportedValue} from './index' | ||
|
||
describe('css-vendor', () => { | ||
describe('.prefix', () => { | ||
it('should be correct for .css', () => { | ||
const {css} = prefix | ||
expect(css).to.be.a('string') | ||
expect(css[0]).to.be('-') | ||
expect(css[css.length - 1]).to.be('-') | ||
expect(css.length >= 3).to.be(true) | ||
}) | ||
|
||
it('shoud be not empty for .js', () => { | ||
expect(prefix.js).to.be.a('string') | ||
}) | ||
}) | ||
|
||
describe('.supportedProperty()', () => { | ||
it('should not prefix', () => { | ||
expect(supportedProperty('display')).to.be('display') | ||
}) | ||
|
||
it('should prefix if needed', () => { | ||
const prop = supportedProperty(`${prefix.css}animation`) | ||
if (prop !== 'animation') { | ||
expect(prop).to.be(`${prefix.css}animation`) | ||
} | ||
}) | ||
|
||
it('should return false', () => { | ||
expect(supportedProperty('xxx')).to.be(false) | ||
}) | ||
}) | ||
|
||
describe('.supportedValue()', () => { | ||
it('should not prefix a simple value', () => { | ||
expect(supportedValue('display', 'none')).to.be('none') | ||
}) | ||
|
||
it('should not prefix a complex value', () => { | ||
const value = 'rgba(255, 255, 255, 1.0)' | ||
expect(supportedValue('color', value)).to.be(value) | ||
}) | ||
|
||
it('should should prefix if needed', () => { | ||
const value = supportedValue('display', 'flex') | ||
if (value !== 'flex') { | ||
expect(value).to.be(`${prefix.css}flex`) | ||
} | ||
}) | ||
|
||
it('should return false for unknown value', () => { | ||
expect(supportedValue('display', 'xxx')).to.be(false) | ||
}) | ||
|
||
it('should return false for "content" value', () => { | ||
expect(supportedValue('content', 'bar')).to.be(false) | ||
}) | ||
}) | ||
}) |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
<title>JSS Tests</title> | ||
<link href="./node_modules/mocha/mocha.css" rel="stylesheet" /> | ||
</head> | ||
<body> | ||
<div id="mocha"></div> | ||
<script src="./node_modules/es5-shim/es5-shim.js"></script> | ||
<script src="./node_modules/mocha/mocha.js"></script> | ||
|
||
<script>mocha.setup('bdd')</script> | ||
<script src="tmp/tests.js"></script> | ||
<script> | ||
mocha.checkLeaks(); | ||
mocha.run(); | ||
</script> | ||
</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,2 @@ | ||
var context = require.context('./src', true, /\.test\.js$/) | ||
context.keys().forEach(context) |
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