mirror of
https://github.com/swc-project/swc.git
synced 2024-11-27 04:47:03 +03:00
Fix travis (#222)
swc_common: - ignore copied doctests swc_ecma_transforms: - fox some tests
This commit is contained in:
parent
046788cf78
commit
33ab0db712
@ -26,8 +26,13 @@ before_install:
|
||||
- git submodule update --init --recursive
|
||||
|
||||
install:
|
||||
- npm i -g jest
|
||||
- cargo test --no-run --color always --all --all-features
|
||||
- if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then rm -rf ~/.nvm ; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then git clone https://github.com/creationix/nvm.git ~/.nvm ; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then source ~/.nvm/nvm.sh ; fi
|
||||
- nvm install 11.6.0
|
||||
- nvm use 11.6.0
|
||||
- npm i -g jest
|
||||
|
||||
script:
|
||||
- RUST_BACKTRACE=full cargo test --color always --all --all-features
|
||||
|
@ -54,7 +54,7 @@ pub struct CodeSuggestion {
|
||||
/// `foo.bar` might be replaced with `a.b` or `x.y` by replacing
|
||||
/// `foo` and `bar` on their own:
|
||||
///
|
||||
/// ```
|
||||
/// ```rust,ignore
|
||||
/// vec![
|
||||
/// Substitution {
|
||||
/// parts: vec![(0..3, "a"), (4..7, "b")],
|
||||
@ -67,7 +67,7 @@ pub struct CodeSuggestion {
|
||||
///
|
||||
/// or by replacing the entire span:
|
||||
///
|
||||
/// ```
|
||||
/// ```rust,ignore
|
||||
/// vec![
|
||||
/// Substitution {
|
||||
/// parts: vec![(0..7, "a.b")],
|
||||
|
@ -147,7 +147,7 @@ impl Mark {
|
||||
/// Computes a mark such that both input marks are descendants of (or equal
|
||||
/// to) the returned mark. That is, the following holds:
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,ignore
|
||||
/// let la = least_ancestor(a, b);
|
||||
/// assert!(a.is_descendant_of(la))
|
||||
/// assert!(b.is_descendant_of(la))
|
||||
@ -368,7 +368,7 @@ impl SyntaxContext {
|
||||
/// the context up one macro definition level. That is, if we have a
|
||||
/// nested macro definition as follows:
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,ignore
|
||||
/// macro_rules! f {
|
||||
/// macro_rules! g {
|
||||
/// ...
|
||||
@ -405,7 +405,7 @@ impl SyntaxContext {
|
||||
/// expansion. For example, consider the following three resolutions of
|
||||
/// `f`:
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,ignore
|
||||
/// mod foo {
|
||||
/// pub fn f() {}
|
||||
/// } // `f`'s `SyntaxContext` is empty.
|
||||
@ -441,7 +441,7 @@ impl SyntaxContext {
|
||||
/// expansion via a glob import with the given `SyntaxContext`.
|
||||
/// For example:
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,ignore
|
||||
/// m!(f);
|
||||
/// macro m($i:ident) {
|
||||
/// mod foo {
|
||||
@ -483,7 +483,7 @@ impl SyntaxContext {
|
||||
|
||||
/// Undo `glob_adjust` if possible:
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,ignore
|
||||
/// if let Some(privacy_checking_scope) = self.reverse_glob_adjust(expansion, glob_ctxt) {
|
||||
/// assert!(self.glob_adjust(expansion, glob_ctxt) == Some(privacy_checking_scope));
|
||||
/// }
|
||||
|
@ -5277,7 +5277,7 @@ test_exec!(
|
||||
r#"
|
||||
var called = false;
|
||||
|
||||
Array: function Array() {
|
||||
function Array() {
|
||||
called = true;
|
||||
}
|
||||
|
||||
|
@ -121,7 +121,7 @@ console.log({ a3, ...b3 } = c3);"#,
|
||||
r#"
|
||||
({ a1 } = c1);
|
||||
var _c2;
|
||||
_c2 = c2, b2 = _objectWithoutProperties(_c2, ['a2']), { a2 } = _c2, _c2;
|
||||
_c2 = c2, b2 = _objectWithoutProperties(_c2, ['a2']), ({ a2 } = _c2), _c2;
|
||||
var _c3;
|
||||
console.log(( _c3 = c3, b3 = _objectWithoutProperties(_c3, ['a3']), { a3 } = _c3, _c3));
|
||||
"#
|
||||
|
@ -1393,15 +1393,15 @@ var Bar = _interopRequireWildcard(require("bar"));
|
||||
|
||||
var _baz = require("baz");
|
||||
|
||||
Foo = ( 42, (function() {
|
||||
Foo = (function() {
|
||||
throw new Error('"' + 'Foo' + '" is read-only.');
|
||||
})());
|
||||
Bar = ( 43, (function() {
|
||||
})();
|
||||
Bar = (function() {
|
||||
throw new Error('"' + 'Bar' + '" is read-only.');
|
||||
})());
|
||||
Baz = ( 44, (function() {
|
||||
})();
|
||||
Baz = (function() {
|
||||
throw new Error('"' + 'Baz' + '" is read-only.');
|
||||
})());
|
||||
})();
|
||||
({ Foo } = ( {
|
||||
}, (function() {
|
||||
throw new Error('"' + 'Foo' + '" is read-only.');
|
||||
|
@ -52,10 +52,7 @@ impl Visit<ExportAll> for ImportAnalyzer {
|
||||
|
||||
impl Visit<NamedExport> for ImportAnalyzer {
|
||||
fn visit(&mut self, export: &NamedExport) {
|
||||
for &NamedExportSpecifier {
|
||||
ref orig,
|
||||
..
|
||||
} in export.specifiers.iter().map(|e| match *e {
|
||||
for &NamedExportSpecifier { ref orig, .. } in export.specifiers.iter().map(|e| match *e {
|
||||
ExportSpecifier::Named(ref e) => e,
|
||||
_ => unreachable!("export default from 'foo'; should be removed by previous pass"),
|
||||
}) {
|
||||
|
@ -685,7 +685,7 @@ let B = _decorate([dec], function (_initialize, _A) {
|
||||
constructor() {
|
||||
var _temp;
|
||||
|
||||
0, _temp = super(), _initialize(this);
|
||||
_temp = super(), _initialize(this), _temp;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ fn cond_simple() {
|
||||
#[test]
|
||||
fn cond_side_effect() {
|
||||
test_expr("new UnknownClass() ? 3 : 6", "new UnknownClass(), 3");
|
||||
test_expr("(void fn()) ? 3 : 6", "void fn(), 6");
|
||||
test_expr("(void fn()) ? 3 : 6", "fn(), 6");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -294,6 +294,8 @@ where
|
||||
.join("testing")
|
||||
.join(test_name);
|
||||
|
||||
create_dir_all(&root).expect("failed to create parent directory for temp directory");
|
||||
|
||||
let tmp_dir = tempdir_in(&root).expect("failed to create a temp directory");
|
||||
create_dir_all(&tmp_dir).unwrap();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user