├── .editorconfig ├── .github ├── ISSUE_TEMPLATE.md └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── .travis.yml ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── bower.json ├── config ├── eslint │ └── default.json ├── jsdoc │ └── default.json ├── karma │ └── default.js ├── mockr │ └── default.js └── rollup │ ├── es5.js │ ├── es6.js │ └── umd.js ├── docs └── tutorials │ └── .gitkeep ├── package.json ├── src └── index.js ├── tests ├── module.js └── support │ ├── fixtures │ └── .gitkeep │ └── mocks │ └── .gitkeep └── tonic-example.js /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | # Unix-style newlines with a newline ending every file 4 | [*] 5 | end_of_line = lf 6 | insert_final_newline = true 7 | indent_style = tab 8 | indent_size = 4 9 | 10 | [*.yml] 11 | indent_style = space 12 | indent_size = 2 13 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Steps to reproduce the issue 2 | 3 | 1. 4 | 5 | ## Expected result 6 | 7 | ## Actual result 8 | 9 | ## Other details 10 | 11 | Version of package: 12 | 13 | Browser: 14 | 15 | Operating system: 16 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Fixes # 2 | 3 | Description of proposed changes: 4 | 5 | - 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | *.*~ 3 | *.db 4 | .goutputstream-* 5 | *.bac 6 | /.project 7 | coverage/ 8 | dist 9 | docs/dist 10 | npm-debug.log 11 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: required 2 | dist: trusty 3 | addons: 4 | firefox: latest 5 | apt: 6 | sources: 7 | - google-chrome 8 | packages: 9 | - google-chrome-stable 10 | language: node_js 11 | node_js: 12 | - '4' 13 | - '6' 14 | - '7' 15 | before_script: 16 | - 'sh -e /etc/init.d/xvfb start' 17 | - 'export DISPLAY=:99.0' 18 | script: npm run build 19 | after_success: npm run coverage 20 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # bemquery Changelog 2 | 3 | All notable changes to this project will be documented in this file. 4 | The format is based on [Keep a Changelog](http://keepachangelog.com/) 5 | and this project adheres to [Semantic Versioning](http://semver.org/). 6 | --- 7 | 8 | ## [0.1.6] – 2017-01-27 9 | ### Added 10 | * Minification of ES6 code using [Babili](https://github.com/babel/babili). 11 | 12 | ## [0.1.5] 13 | ### Fixed 14 | * Fixed not working Bower distribution. 15 | 16 | ## [0.1.4] 17 | ### Added 18 | * Ability to install package via [Bower](https://bower.io/). 19 | 20 | ### Changed 21 | * Changelog is now compliant with [Keep a Changelog](http://keepachangelog.com/) format. 22 | 23 | 24 | ## [0.1.3] – 2016-08-08 25 | ### Changed 26 | * Updated boilerplate. 27 | 28 | ### Fixed 29 | * Fixed changelog. 30 | 31 | ## [0.1.2] – 2016-07-10 32 | ### Changed 33 | * Updated CI configuration. 34 | * Updated dependencies. 35 | 36 | ## [0.1.1] – 2016-06-25 37 | ### Changed 38 | * Updated rollup configuration. 39 | * Updated dependencies. 40 | 41 | ### Fixed 42 | * Fixed wrong project name in documentation. 43 | 44 | ## [0.1.0] – 2016-05-09 45 | ### Changed 46 | * Updated boilerplate. 47 | * Updated dependencies. 48 | * Added [bemquery-selector-converter](https://github.com/BEMQuery/bemquery-selector-converter) module as dependency. 49 | 50 | ## 0.0.1 – 2016-05-01 51 | ### Added 52 | * First working version. 53 | 54 | [0.1.6]: https://github.com/BEMQuery/bemquery/compare/v0.1.5...v0.1.6 55 | [0.1.5]: https://github.com/BEMQuery/bemquery/compare/v0.1.4...v0.1.5 56 | [0.1.4]: https://github.com/BEMQuery/bemquery/compare/v0.1.3...v0.1.4 57 | [0.1.3]: https://github.com/BEMQuery/bemquery/compare/v0.1.2...v0.1.3 58 | [0.1.2]: https://github.com/BEMQuery/bemquery/compare/v0.1.1...v0.1.2 59 | [0.1.1]: https://github.com/BEMQuery/bemquery/compare/v0.1.0...v0.1.1 60 | [0.1.0]: https://github.com/BEMQuery/bemquery/compare/v0.0.1...v0.1.0 61 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | First of all: thanks for your effort! 4 | 5 | ## Reporting an issue/proposing new feature 6 | 7 | 1. If you encounters an issue while working with this package, first of all ensures it's caused by the package itself, not any third-party code or your browser (you can ) 8 | 2. If the issue is caused by the package, [create a new issue](/../../issues/new) for it, according to the template. 9 | 3. If you want to propose new feature instead of reporting an issue, just delete issue's template and write small explanation why you want this feature and why should we implement it. 10 | 11 | ## Contributing code 12 | 13 | 1. If you want to contribute code to this package, you should do it via [pull request](/../../pulls). 14 | 2. First of all, fork this repository and create `t/` branch, where `` is a number of [an issue](/../../issues) you're going to fix. 15 | 3. Write your code and commit to your branch. 16 | 4. Ensure that everything is working by writing some tests and building the package (`npm run build`). 17 | 5. If you're changing some existing methods or adding new ones, remember about [updating API docs](http://usejsdoc.org/). 18 | 6. If everything's working fine, you can create a new pull request and relax, waiting for merge! 19 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016-2017 BEMQuery 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # bemquery 2 | 3 | [![Build Status](https://travis-ci.org/BEMQuery/bemquery.svg?branch=master)](https://travis-ci.org/BEMQuery/bemquery) · [![Dependency Status](https://david-dm.org/BEMQuery/bemquery.svg)](https://david-dm.org/BEMQuery/bemquery) · [![devDependency Status](https://david-dm.org/BEMQuery/bemquery/dev-status.svg)](https://david-dm.org/BEMQuery/bemquery?type=dev) · [![Known Vulnerabilities](https://snyk.io/test/github/bemquery/bemquery/badge.svg)](https://snyk.io/test/github/bemquery/bemquery) ·[![Package quality](http://packagequality.com/badge/bemquery.png)](http://packagequality.com/#?package=bemquery) · [![npm version](https://badge.fury.io/js/bemquery.svg)](https://badge.fury.io/js/bemquery) · [![Bower version](https://badge.fury.io/bo/bemquery.svg)](https://badge.fury.io/bo/bemquery) · [![codecov](https://codecov.io/gh/BEMQuery/bemquery/branch/master/graph/badge.svg)](https://codecov.io/gh/BEMQuery/bemquery) 4 | 5 | BEMQuery library. 6 | 7 | --- 8 | 9 | ## Installation 10 | 11 | You can install this package from npm: 12 | ```bash 13 | npm install bemquery [--save] 14 | ``` 15 | 16 | You can also install it from bower: 17 | ```bash 18 | bower install bemquery 19 | ``` 20 | 21 | ## Documentation 22 | 23 | Docs are available at http://bemquery.github.io/bemquery 24 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bemquery", 3 | "description": "BEMQuery library", 4 | "main": "dist/bemquery.umd.js", 5 | "authors": [ 6 | { 7 | "name": "BEMQuery team", 8 | "url": "https://github.com/BEMQuery" 9 | } 10 | ], 11 | "license": "MIT", 12 | "keywords": [ 13 | "BEM", 14 | "BEMQuery" 15 | ], 16 | "homepage": "https://github.com/BEMQuery/bemquery", 17 | "ignore": [ 18 | "**/.*", 19 | "node_modules", 20 | "bower_components", 21 | "config", 22 | "CONTRIBUTING.md", 23 | "docs", 24 | "test", 25 | "tests", 26 | "tonic-example.js", 27 | "src" 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /config/eslint/default.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "browser": true, 4 | "commonjs": true, 5 | "es6": true, 6 | "node": true, 7 | "mocha": true 8 | }, 9 | "extends": "eslint:recommended", 10 | "parserOptions": { 11 | "sourceType": "module", 12 | "ecmaFeatures": { 13 | "impliedStrict": true 14 | } 15 | }, 16 | "rules": { 17 | "indent": [ 2, "tab" ], 18 | "linebreak-style": [ 2, "unix" ], 19 | "quotes": [ 2, "single" ], 20 | "semi": [ 2, "always" ], 21 | "curly": 2, 22 | "brace-style": [2, "1tbs" ], 23 | "camelcase": [ 2, { "properties": "always" } ], 24 | "comma-spacing": [ 2, { "before": false, "after": true } ], 25 | "comma-style": [ 2, "last" ], 26 | "key-spacing": [ 2, { "mode": "strict", "beforeColon": false, "afterColon": true } ], 27 | "keyword-spacing": 2, 28 | "block-spacing": 2, 29 | "array-bracket-spacing": [ 2, "always" ], 30 | "object-curly-spacing": [ 2, "always" ], 31 | "computed-property-spacing": [ 2, "always" ], 32 | "space-in-parens": [ 2, "always" ], 33 | "space-before-function-paren": [ 2, "never" ], 34 | "generator-star-spacing": [ 2, "after" ], 35 | "yield-star-spacing": [ 2, "after" ], 36 | "space-infix-ops": 2, 37 | "space-unary-ops": 2, 38 | "spaced-comment": [ 2, "always" ], 39 | "arrow-spacing": [2, { "before": true, "after": true } ], 40 | "arrow-parens": [ 2, "always" ], 41 | "arrow-body-style": [ 2, "always" ], 42 | "no-trailing-spaces": 2, 43 | "no-multiple-empty-lines": [ 2, { "max": 1 } ], 44 | "eol-last": 2, 45 | "valid-jsdoc": 2, 46 | "no-implicit-coercion": [ 2, { "allow": [ "!!" ] } ], 47 | "no-native-reassign": 2, 48 | "wrap-iife": [ 2, "outside" ], 49 | "yoda": [ 2, "never" ], 50 | "prefer-arrow-callback": 2, 51 | "prefer-const": 2, 52 | "no-var": 2, 53 | "prefer-template": 2, 54 | "prefer-rest-params": 2, 55 | "prefer-spread": 2, 56 | "object-shorthand": [ 2, "always" ], 57 | "no-array-constructor": 2, 58 | "no-new-object": 2, 59 | "new-cap": 2, 60 | "new-parens": 2, 61 | "no-lonely-if": 2, 62 | "no-use-before-define": 2, 63 | "no-with": 2, 64 | "eqeqeq": [ 2, "smart" ] 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /config/jsdoc/default.json: -------------------------------------------------------------------------------- 1 | { 2 | "opts": { 3 | "template": "./node_modules/docdash", 4 | "encoding": "utf8", 5 | "destination": "./docs/dist", 6 | "recurse": true, 7 | "tutorials": "./docs/tutorials", 8 | "readme": "./README.md" 9 | }, 10 | "docdash": { 11 | "static": true, 12 | "sort": true 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /config/karma/default.js: -------------------------------------------------------------------------------- 1 | module.exports = function( config ) { 2 | config.set( { 3 | failOnEmptyTestSuite: false, 4 | 5 | // base path that will be used to resolve all patterns (eg. files, exclude) 6 | basePath: '../../', 7 | 8 | 9 | // frameworks to use 10 | // available frameworks: https://npmjs.org/browse/keyword/karma-adapter 11 | frameworks: [ 12 | 'mocha', 13 | 'sinon-chai', 14 | 'fixture' 15 | ], 16 | 17 | 18 | // list of files / patterns to load in the browser 19 | files: [ 20 | 'tests/**/*.js', 21 | 'tests/support/fixtures/**/*' 22 | ], 23 | 24 | 25 | // list of files to exclude 26 | exclude: [ 27 | 'tests/support/**/*.js' 28 | ], 29 | 30 | 31 | // preprocess matching files before serving them to the browser 32 | // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor 33 | preprocessors: { 34 | 'tests/**/*.js': [ 'rollup' ], 35 | 'tests/support/fixtures/**/*.html': [ 'html2js' ], 36 | 'tests/support/fixtures/**/*.json': [ 'json_fixtures' ] 37 | }, 38 | 39 | 40 | // test results reporter to use 41 | // possible values: 'dots', 'progress' 42 | // available reporters: https://npmjs.org/browse/keyword/karma-reporter 43 | reporters: [ 44 | 'progress', 45 | 'coverage' 46 | ], 47 | 48 | 49 | // web server port 50 | port: 9876, 51 | 52 | 53 | // enable / disable colors in the output (reporters and logs) 54 | colors: true, 55 | 56 | 57 | // level of logging 58 | // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG 59 | logLevel: config.LOG_INFO, 60 | 61 | 62 | // enable / disable watching file and executing tests whenever any file changes 63 | autoWatch: false, 64 | 65 | 66 | // start these browsers 67 | // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher 68 | browsers: [ 69 | 'Chrome', 70 | 'Firefox' 71 | ], 72 | 73 | 74 | // Continuous Integration mode 75 | // if true, Karma captures browsers, runs the tests and exits 76 | singleRun: true, 77 | 78 | // Concurrency level 79 | // how many browser should be started simultaneous 80 | concurrency: 1, 81 | 82 | rollupPreprocessor: { 83 | plugins: [ 84 | require( 'rollup-plugin-istanbul' )( { 85 | exclude: [ 'tests/**/*.js' ] 86 | } ), 87 | require( 'rollup-plugin-mockr' )( require( '../mockr/default' ) ), 88 | require( 'rollup-plugin-commonjs' )(), 89 | require( 'rollup-plugin-node-resolve' )( { 90 | jsnext: true, 91 | main: false 92 | } ) 93 | ], 94 | format: 'iife' 95 | }, 96 | 97 | jsonFixturesPreprocessor: { 98 | variableName: '__json__' 99 | }, 100 | 101 | coverageReporter: { 102 | reporters: [ 103 | { type: 'text-summary' }, 104 | { type: 'lcovonly' } 105 | ] 106 | } 107 | } ); 108 | }; 109 | -------------------------------------------------------------------------------- /config/mockr/default.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | 5 | }; 6 | -------------------------------------------------------------------------------- /config/rollup/es5.js: -------------------------------------------------------------------------------- 1 | import config from './umd.js'; 2 | import babel from 'rollup-plugin-babel'; 3 | import uglify from 'rollup-plugin-uglify'; 4 | 5 | const packageInfo = require( '../../package.json' ); 6 | 7 | // Ovewrite original Babel plugin. 8 | config.plugins[ 2 ] = babel( { 9 | presets: [ 10 | [ 'es2015', { modules: false } ] 11 | ], 12 | plugins: [ 'external-helpers' ] 13 | } ); 14 | 15 | config.plugins.push( uglify( { 16 | output: { 17 | preamble: config.banner 18 | } 19 | } ) ); 20 | 21 | config.dest = `dist/${packageInfo.name}.es5.js`; 22 | 23 | export default config; 24 | -------------------------------------------------------------------------------- /config/rollup/es6.js: -------------------------------------------------------------------------------- 1 | import nodeResolve from 'rollup-plugin-node-resolve'; 2 | import convertCJS from 'rollup-plugin-commonjs'; 3 | import babili from 'rollup-plugin-babili'; 4 | 5 | const packageInfo = require( '../../package.json' ); 6 | const banner = `/*! ${packageInfo.name} v${packageInfo.version} | (c) 2016-${new Date().getFullYear()} ${packageInfo.author.name} | ${packageInfo.license} license (see LICENSE) */`; 7 | 8 | export default { 9 | entry: 'src/index.js', 10 | format: 'es', 11 | sourceMap: true, 12 | plugins: [ 13 | nodeResolve( { 14 | jsnext: true, 15 | main: false 16 | } ), 17 | convertCJS(), 18 | babili( { 19 | comments: false, 20 | banner 21 | } ) 22 | ], 23 | banner, 24 | dest: `dist/${packageInfo.name}.js` 25 | }; 26 | -------------------------------------------------------------------------------- /config/rollup/umd.js: -------------------------------------------------------------------------------- 1 | import config from './es6.js'; 2 | 3 | const packageInfo = require( '../../package.json' ); 4 | 5 | config.format = 'umd', 6 | config.moduleName = 'bemquery'; 7 | config.dest = `dist/${packageInfo.name}.umd.js`; 8 | 9 | export default config; 10 | -------------------------------------------------------------------------------- /docs/tutorials/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BEMQuery/bemquery/41c211a0d1946cdd529342ba4b7344db306f3741/docs/tutorials/.gitkeep -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bemquery", 3 | "version": "0.1.6", 4 | "description": "BEMQuery library", 5 | "main": "dist/bemquery.umd.js", 6 | "jsnext:main": "dist/bemquery.js", 7 | "module": "dist/bemquery.js", 8 | "scripts": { 9 | "lint": "eslint -c config/eslint/default.json src/**/*.js tests/**/*.js", 10 | "pretest": "npm run lint", 11 | "test": "karma start config/karma/default.js", 12 | "coverage": "codecov", 13 | "precommit": "npm test", 14 | "commitmsg": "commitplease .git/COMMIT_EDITMSG", 15 | "prebuild": "npm test", 16 | "build": "rollup -c config/rollup/umd.js && rollup -c config/rollup/es6.js && rollup -c config/rollup/es5.js", 17 | "build-docs": "jsdoc -c config/jsdoc/default.json ./src", 18 | "publish-docs": "npm run build-docs && git checkout gh-pages && ncp docs/dist ./ && git add -A && git commit -m \"docs(gh-pages): update docs [ci skip]\" && git push origin gh-pages && git checkout master", 19 | "preversion": "npm run build && git add -f dist/", 20 | "postversion": "git rm -r --cached dist/ && git commit -m \"chore(dist): clean after release [ci skip]\" && git push origin && git push origin --tags", 21 | "prepublish": "in-publish && npm run build || exit 0" 22 | }, 23 | "commitplease": { 24 | "nohook": true, 25 | "style": "angular", 26 | "types": [ 27 | "feat", 28 | "fix", 29 | "docs", 30 | "style", 31 | "refactor", 32 | "perf", 33 | "test", 34 | "build", 35 | "ci", 36 | "chore", 37 | "revert" 38 | ], 39 | "scope": "\\S+.*" 40 | }, 41 | "repository": { 42 | "type": "git", 43 | "url": "git+https://github.com/BEMQuery/bemquery.git" 44 | }, 45 | "keywords": [ 46 | "BEM", 47 | "BEMQuery" 48 | ], 49 | "files": [ 50 | "dist", 51 | "tonic-example.js" 52 | ], 53 | "author": { 54 | "name": "BEMQuery team", 55 | "url": "https://github.com/BEMQuery" 56 | }, 57 | "license": "MIT", 58 | "bugs": { 59 | "url": "https://github.com/BEMQuery/bemquery/issues" 60 | }, 61 | "homepage": "https://github.com/BEMQuery/bemquery#readme", 62 | "tonicExampleFilename": "tonic-example.js", 63 | "devDependencies": { 64 | "babel-plugin-external-helpers": "^6.8.0", 65 | "babel-preset-es2015": "^6.13.2", 66 | "bemquery-async-dom": "^0.1.1", 67 | "bemquery-core": "^0.1.1", 68 | "bemquery-dom-events": "^0.1.0", 69 | "bemquery-selector-converter": "^0.1.1", 70 | "bemquery-selector-engine": "^0.2.1", 71 | "chai": "^3.5.0", 72 | "codecov": "^1.0.1", 73 | "commitplease": "^2.7.2", 74 | "cz-conventional-changelog": "^1.2.0", 75 | "docdash": "^0.4.0", 76 | "eslint": "^3.0.1", 77 | "husky": "^0.13.1", 78 | "in-publish": "^2.0.0", 79 | "jsdoc": "^3.4.0", 80 | "karma": "^1.0.0", 81 | "karma-chrome-launcher": "^2.0.0", 82 | "karma-coverage": "^1.1.1", 83 | "karma-firefox-launcher": "^1.0.0", 84 | "karma-fixture": "^0.2.6", 85 | "karma-html2js-preprocessor": "^1.0.0", 86 | "karma-json-fixtures-preprocessor": "0.0.6", 87 | "karma-mocha": "^1.0.1", 88 | "karma-rollup-preprocessor": "^3.0.1", 89 | "karma-sinon-chai": "^1.2.0", 90 | "lolex": "^1.4.0", 91 | "mocha": "^3.0.2", 92 | "ncp": "^2.0.0", 93 | "rollup": "^0.41.1", 94 | "rollup-plugin-babel": "^2.6.1", 95 | "rollup-plugin-commonjs": "^7.0.0", 96 | "rollup-plugin-istanbul": "^1.1.0", 97 | "rollup-plugin-mockr": "^1.0.1", 98 | "rollup-plugin-node-resolve": "^2.0.0", 99 | "rollup-plugin-babili": "^1.0.3", 100 | "rollup-plugin-uglify": "^1.0.1", 101 | "sinon": "^1.17.4", 102 | "sinon-chai": "^2.8.0", 103 | "uglify-js": "^2.6.2" 104 | }, 105 | "config": { 106 | "commitizen": { 107 | "path": "./node_modules/cz-conventional-changelog" 108 | } 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | import * as $ from 'bemquery-core'; 4 | import 'bemquery-async-dom'; 5 | import 'bemquery-dom-events'; 6 | 7 | export default $; 8 | -------------------------------------------------------------------------------- /tests/module.js: -------------------------------------------------------------------------------- 1 | /* global chai */ 2 | 3 | 'use strict'; 4 | 5 | import { default as lib } from '../src/index'; 6 | 7 | const expect = chai.expect; 8 | 9 | const $ = lib.default; 10 | const BEMQuery = lib.BEMQuery; 11 | 12 | describe( '$', () => { 13 | it( 'is a function', () => { 14 | expect( $ ).to.be.a( 'function' ); 15 | } ); 16 | } ); 17 | 18 | describe( 'BEMQuery', () => { 19 | it( 'is a class', () => { 20 | expect( BEMQuery ).to.be.a( 'function' ); 21 | } ); 22 | 23 | it( 'has get method', () => { 24 | expect( BEMQuery.prototype.get ).to.be.a( 'function' ); 25 | } ); 26 | 27 | it( 'has each method', () => { 28 | expect( BEMQuery.prototype.each ).to.be.a( 'function' ); 29 | } ); 30 | 31 | it( 'has on method', () => { 32 | expect( BEMQuery.prototype.on ).to.be.a( 'function' ); 33 | } ); 34 | 35 | it( 'has off method', () => { 36 | expect( BEMQuery.prototype.off ).to.be.a( 'function' ); 37 | } ); 38 | 39 | it( 'has read method', () => { 40 | expect( BEMQuery.prototype.read ).to.be.a( 'function' ); 41 | } ); 42 | 43 | it( 'has write method', () => { 44 | expect( BEMQuery.prototype.write ).to.be.a( 'function' ); 45 | } ); 46 | 47 | it( 'has getStates method', () => { 48 | expect( BEMQuery.prototype.getStates ).to.be.a( 'function' ); 49 | } ); 50 | 51 | it( 'has html method', () => { 52 | expect( BEMQuery.prototype.get ).to.be.a( 'function' ); 53 | } ); 54 | } ); 55 | -------------------------------------------------------------------------------- /tests/support/fixtures/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BEMQuery/bemquery/41c211a0d1946cdd529342ba4b7344db306f3741/tests/support/fixtures/.gitkeep -------------------------------------------------------------------------------- /tests/support/mocks/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BEMQuery/bemquery/41c211a0d1946cdd529342ba4b7344db306f3741/tests/support/mocks/.gitkeep -------------------------------------------------------------------------------- /tonic-example.js: -------------------------------------------------------------------------------- 1 | require( 'bemquery-selector-engine/package.json' ); 2 | 3 | var fs = require( 'fs' ), 4 | url = require( 'url' ), 5 | endpoint = 'https://tonicdev.io' + process.env.TONIC_ENDPOINT_PATH; 6 | 7 | exports.tonicEndpoint = function( request, response ) { 8 | const package = url.parse( request.url, true ).query.package; 9 | 10 | response.end( fs.readFileSync( require.resolve( 'bemquery-' + package ) ) ); 11 | }; 12 | 13 | 14 | 15 | ` 16 | 17 | 18 | 19 | Tonic Example 20 | 21 | 22 |

Example

23 | 24 | 25 | 28 | 29 | `; 30 | --------------------------------------------------------------------------------